swiftmailer - How to make SUBJECT Substitutions in Sendgrid Swift SmtpTransport? -
i using swift smtptransport seems recommended way.
however documentation found dos not show how achieve subject substitutions.
this answered on github, answering here too, folks future reference.
to use smtpapi substitute subjects, you'll need substitution tags in subject of email , include x-smtpapi
header substitution tags defined.
using sendgrid smtpapi library:
<?php ... $message->setsubject('[sendgrid-php-example] owl named %yourname%'); $header = new smtpapi\header(); $header->addsubstitution("%yourname%", array("mr. owl"))-> ...
Comments
Post a Comment