When sending multiple emails via SendGrid's personalizations argument the sanitized recipients are not applied (although the other sanitizations seem to be. I haven't been able to dive deep into the difference of how this option sends to give more insight yet, but I wanted to get this issue recorded. I'll do some more research tomorrow and update this issue.
mail({
to: "account@external_domain.com", # Properly sanitized
from: "mail@website.com",
subject: "Hello",
body: "World!",
personalizations: [
{
to: [{ email: "second_account@external_domain.com"}], # Not properly sanitized, sent to actual recipient
bcc: [{ email: "copy@external_domain.com"}] # Also, not properly sanitized, sent to actual recipient
},
]
})
Under normal circumstances, SendGrid would create two emails from this request. One to account@external_domain.com and one to second_account@external_domain.com with a bcc to copy@external_domain.com.
Update 2020-08-17 11:03AM ET
This is more likely to be the sendgrid-actionmailer gem than the sendgrid-ruby gem.
When sending multiple emails via SendGrid's
personalizations
argument the sanitized recipients are not applied (although the other sanitizations seem to be. I haven't been able to dive deep into the difference of how this option sends to give more insight yet, but I wanted to get this issue recorded. I'll do some more research tomorrow and update this issue.Under normal circumstances, SendGrid would create two emails from this request. One to
account@external_domain.com
and one tosecond_account@external_domain.com
with a bcc tocopy@external_domain.com
.Update 2020-08-17 11:03AM ET This is more likely to be the sendgrid-actionmailer gem than the
sendgrid-ruby
gem.