swiftmailer/swiftmailer — Issue #161: Decorator Plugin Using Same Data for everyone
Author: jamessampford
Created: 2012-01-24 21:06:28+00:00
State: open

I'm not sure if it is a bug or it's the way I've put together my email processor, but for some reason emails using the same replacement fields (but different contents) are using the exact same data as the first email sent out, but only if it is in the same output cycle (basically my script checks for new email to send every 5 minutes and loops around until there is something to send).

What's more strange is that I'm sending email one at a time (so it's not like I'm batching it).

I've outputted the replacement data (to cron email) to pass to the decorator plugin and the replacements are 100% correct. I've gone deep into the plugin and outputted the message data to cron email and that suggests that once a replacement is made, it is stuck there if the same email template is passed through.

Could it be that my emailer is a class, and within it (in a function) i'm creating a new instance of the decorator plugin (though i don't see any other way to pass the replacements to the plugin) before doing all the processing and email building as normal?

If this is a bug, I hope this helps - if not, then maybe I'm doing something wrong in my emailing class (but I don't think I am) otherwise I guess I have to use str_replace (or something) to replace every replaceable....