sendgrid / wordpress

SendGrid plugin for WordPress
51 stars 64 forks source link

Heroku addon and confusion over username/password deprecation #72

Open maxim opened 6 years ago

maxim commented 6 years ago

Hi folks,

Unfortunately spent a few hours on this one.

I installed WP on Heroku, added SendGrid addon, and for the life of me couldn't understand why it wouldn't work. I started researching whether I set my ENV variables correctly (taken from an example wordpress-on-heroku app):

  define('SENDGRID_AUTH_METHOD', 'credentials');
  define('SENDGRID_USERNAME', getenv('SENDGRID_USERNAME'));
  define('SENDGRID_PASSWORD', getenv('SENDGRID_PASSWORD'));
  define('SENDGRID_SEND_METHOD', 'api');
  define('SENDGRID_FROM_NAME', 'Example Name');
  define('SENDGRID_FROM_EMAIL', 'from_email@example.com');
  define('SENDGRID_REPLY_TO', 'reply_to@example.com');

and while doing research, I found that there is not a single mention of SENDGRID_AUTH_METHOD anywhere in this repo when you search it on github. (Mentioning it in this issue for future searches).

It took me way too long to find out that as of 1.11.x credentials (username/password) are no longer supported. It was weird, because your Heroku addon specifically adds those 2 things to ENV vars, and does not add an API key. However then I found that in Heroku docs you tell people to create the API key manually.

The manual step really puts a stick in the wheels of our automated infrastructure for new apps.

I would like to both inform others to use 1.10.9 if they want automated Heroku integration, and to ask the team — please make Heroku addon auto-create SENDGRID_API_KEY when installed. It would help make things automated, and I'm sure clear up some confusion.