문제

I am using Swift SmtpTransport as it seems to be the recommended way.

However the documentation I found dos not show how to achieve Subject Substitutions.

도움이 되었습니까?

해결책

This was answered on Github, answering here too, for folks future reference.

To use the SMTPAPI to substitute for subjects, you'll need substitution tags in the subject of the email and then include the x-smtpapi header with substitution tags defined.

Using the SendGrid SMTPAPI Library:

<?php
...
$message->setSubject('[sendgrid-php-example] Owl named %yourname%');
$header           = new Smtpapi\Header();
$header->addSubstitution("%yourname%", array("Mr. Owl"))->
...
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top