I'm trying to send batch emails with each email having its own custom email messages and custom embedded file. However,
the following code
Code: Select all
$swift->attachPlugin(new Swift_Plugin_Decorator($replacements), "decorator");
$swift->attachPlugin(new Swift_Plugin_FileEmbedder(), "file_embedder");
$message = new Swift_Message(EMAIL_SUBJECT_TEXT);
$message->attach(new Swift_Message_Part(MESSAGE_TEMPL));
$message->attach(new Swift_Message_Part(MESSAGE_TEMPL, 'text/html'));
$swift->batchSend($message, $recipients, SENDER_EMAIL);
If i were to switch around the plugin instantances
Code: Select all
$swift->attachPlugin(new Swift_Plugin_FileEmbedder(), "file_embedder");$swift->attachPlugin(new Swift_Plugin_Decorator($replacements), "decorator");
$message = new Swift_Message(EMAIL_SUBJECT_TEXT);
$message->attach(new Swift_Message_Part(MESSAGE_TEMPL));
$message->attach(new Swift_Message_Part(MESSAGE_TEMPL, 'text/html'));
$swift->batchSend($message, $recipients, SENDER_EMAIL);
How do these plugins work?
Why is there this conflict?
Is there anything else I can do as a work around?