Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

BCC and Decorator plugin #770

Closed
edwh opened this issue Jun 17, 2016 · 3 comments
Closed

BCC and Decorator plugin #770

edwh opened this issue Jun 17, 2016 · 3 comments

Comments

@edwh
Copy link

edwh commented Jun 17, 2016

I'm wanting to use the Decorator plugin to send out mails to a mailing list. I don't want the members of the mailing list to see the email addresses of other members, but it looks like the Decorator plugin only processes the To recipients. Shouldn't it process BCC recipients as well?

makasim pushed a commit to formapro-forks/swiftmailer that referenced this issue Jul 26, 2017
@Cipa
Copy link

Cipa commented Oct 31, 2017

Anyone has a fix for this?
Thank you

@daduque
Copy link

daduque commented Nov 3, 2017

I found a solution for this issue, try modify the file DecoratorPlugin.php on the path vendor->swiftmailer->lib->classes->swift->plugins->decorator

Replace the line $to = array_keys($message->getTo()); for $to = array_keys($message->getBcc());, I changed it cause I only need the Bcc way to send, but if you need both, try with a if() cheking if addTo is empty or not.

The error message is because always check first the TO way, if you didn't use it (only use Bcc), the swiftMailer catch that message.

I hope this help.

@Cipa
Copy link

Cipa commented Nov 3, 2017

I did that but did not work entirely for me as only one email was sent. I discovered that the Decorator was not replacing values in the secondary emails and I believe the server was not sending the same email multiple times.

I ended up doing a foreach loop.

@fabpot fabpot closed this as completed Nov 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants