SMTP module is the recommended integration module for Sendgrid and Drupal http://docs.sendgrid.com/documentation/get-started/integrate/examples/dr... but there are a couple of things that probably should be tweaked especially for Sendgrid.

As probably the majority of users don't use Sendgrid, I'd suggest putting Sendgrid-specific changes into a separate module. Would the maintainers want to consider having that in the SMTP project due to the hard dependency on SMTP.module, or is it preferred to have that module entirely separate?

The first thing that I'd put in the separate Sendgrid module would be a very small mail_alter hook that changes the default encoding to quoted-printable, as Sendgrid's conversion from the Drupal default 8bit to QP encoding is buggy - phpmailer will handle the conversion correctly when specified, and that bypasses Sendgrid's QP encoder. This could be just another option in the SMTP config interface to change the Content-Transfer-Encoding (phpmailer picks this up and reacts appropriately), but I imagine there are a number of these sendgrid-specific changes (changing to quoted-printable encoding only makes sense if you know you need to do so). I can see the case for having this one specific option available to change in the SMTP admin interface, but for example, Sendgrid's SMTPAPI offers a number of options that users might want to take advantage of in a separate module ( http://docs.sendgrid.com/documentation/api/smtp-api/developers-guide/ )

Comments

technicalknockout’s picture

I'm very interested in building on this idea (I'm currently working on a project that will be interfacing with sendgrid). I'm thinking a sandbox module would be ideal to work out the details. Sort out what those sendgrid-specific adjustments would be, then if it makes sense & the maintainers are into it see about merging back into this module.

technicalknockout’s picture

BTW, there is already a PHP library for sendgrid on github: https://github.com/alonbendavid/SendGrid-PHP-Library

wundo’s picture

Status: Active » Closed (works as designed)