Skip to content

hoborglabs/sendgrid

Repository files navigation

Sendgrid PHAR cli

Simple, single.phar SendGrid cli.

You have to create ~/.sendgrid/config.ini with your SendGrid username and password.

username = my_username
password = my_password

Commands

Send

./sendgrid.phar send \
  --to developers@test.com \
  --body @/path/to/emailBody \
  --subject "test email"

Combined with some git magic

# Generate list of committers
git log origin/master..origin/my-branch \
  --format=%ae \
  | sort | uniq > committers-emails

# Generate simple change log
echo "Changes: \
" `git log --no-merges origin/master..origin/my-branch --format=" o  %s (%an)"` > changes

./sendgrid.phar send --to '@committers-emails' --body '@changes --subject "Release Notes"'