PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Fri Nov 24, 2017 1:13 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Sun Jul 17, 2011 12:16 pm 
Offline
Forum Regular
User avatar

Joined: Tue Jul 30, 2002 10:21 am
Posts: 852
Location: Trinidad, West Indies
Hi,

I'm trying to send batch emails with each email having its own custom email messages and custom embedded file. However,

the following code

Syntax: [ Download ] [ Hide ]
$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);


Embeds the image but doesn't replace each text as expected ( it only replaced it once thus each successive email has the first custom messages & embedded image)

If i were to switch around the plugin instantances

Syntax: [ Download ] [ Hide ]
$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);


The decorator operates as it should...however the images DON'T get embedded.

How do these plugins work?
Why is there this conflict?

Is there anything else I can do as a work around?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group