html and text emails from same plugin
-
I need to send both HTML and TEXT emails. If I set the plugin to text/plain then the text emails go fine but the HTML emails look weird.
Likewise, if I change the plugin to text/html then the HTML emails look fine but the text ones look weird (even though I have ‘don’t convert to HTML’ set in the SendGrid site settings).
Ideally I’d like to be able to set the content type in the headers as I did when I used the non-SendGrid wp_mail.
$headers = array( 'Content-Type: text/html' );
But… how can I do that in the SendGrid headers?
$headers = new SendGrid\Email();
$headers->setUniqueArgs(array( 'arg1' => $pTitle ))
->addCategory('my_category');
Where can I add the content type to this?
Thanks.
- The topic ‘html and text emails from same plugin’ is closed to new replies.