-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.2] Sparkpost bcc #13237
[5.2] Sparkpost bcc #13237
Conversation
In the _getFrom()_ method, Instead of doing:
You could do:
|
@BrandonSurowiec is there any need for that? Just passing the array itself is more verbose, no? |
@jbrooksuk It's cleaner and easier to read IMO since it gets rid of the duplication. Taylor uses it throughout the Laravel source. |
@jbrooksuk I agree with @BrandonSurowiec, its more consistent with the framework |
@pochocho I'm working on a fix for Sparkpost's driver. Which mail client have you used to find the BCC issue? I've tried this code with "email_rfc822" (billmn@e2d0378) and using OS X Mail and Gmail ... all seems ok. Can you give me a feedback? |
@billmn I saw the issue on thunderbird. Also the issue happens when sending to multiple recipients at once. It gets fixed with my solution that was merged, by assigning an individual header for each BCC recipient. |
My code restore the use of "email_rfc822" To simplify the driver and fix some issues. After some tests I haven't found the BCC issue. |
@billmn are you sending to multiple recipients? when using multiple I had 2 scenarios if I sent the array as the "to" option, evryone could access the recipients addresses. If done through BCC, the email client wouldn't show a "to" field. How are you calling the mail function? just to check if it has to do on how I'm doing it. |
Yes, I have used this code and all seems work. No BCC's addresses in the TO field. Mail::send('test', [], function($message) {
$message
->to([
'address1@mail.dev',
'address2@mail.dev',
])
->bcc([
'address3@mail.dev',
'address4@mail.dev',
])
->subject('Test from SparkPost')
->attach(public_path('robots.txt'));
}); |
I tried your code and got the same results. the problem is not that BCC fields show. its the fact that no address appears in the "to" field. on the email yo see something like: From: noreply@domain.com Tested on Gmail and Thunderbird, both with the same results. I'm using mail function as follows:
|
Is absolutely normal that TO field is empty if you specify addresses only in BCC field. |
Yes but the issue I opened is because when using mandrill you could send an email to mass recipients all in the "to" field and the full list of recipients would not be made public. The only work around is to send them trough BCC but email recipients should be able to see the email address that the email was sent to. using 'email_rfc822' overwirtes any headers set to recipients. Which I set in the following section of the code in the getRecepients function:
This is also specified in the sparkpost api docs |
@pochocho I did some tests using: Mail::send('test', [], function($message) {
$message
->bcc([
'address3@mail.dev',
'address4@mail.dev',
])
->subject('Test from SparkPost')
->attach(public_path('robots.txt'));
}); and no address appears in the "TO" field also with SMTP and Mailgun driver. |
@billmn havent tried those to drivers. Strange that the attachments wont work without rfc_822 I can look into it next week if you havent figured it out. Im away this weekend. |
I found that when sending to multiple email addresses would result to all addresses displaying in the "to" field of the email. This did not happen with Mandrill. After reading the SparkPost Docs, the use of the BCC field is the only way to hide email addresses, but the current implementation would not allow to set the "header_to" option on the recipients because of the usage of the "email_rfc822" for the content. This is my first contribution so I understand my code might not be the best so bear with me, any suggestions/comments appreciated.