Personalization causes duplicate to
email and sometimes causes multiple emails
#467
Labels
type: bug
bug in the library
to
email and sometimes causes multiple emails
#467
Issue Summary
When including a BCC array, the
sendgrid-ruby
client either errors if an additionalto
is not provided, and when an additionalto
is provided can intermittently cause multiple duplicate emails to be sent.Steps to Reproduce the Issue
Following the kitchen sink example from https://github.com/sendgrid/sendgrid-ruby/blob/6.3.3/examples/helpers/mail/example.rb#L21
The output of
mail.to_json
(not actually JSON, but a rubyHash
)Note that a
to
array is present in the only entry in thepersonalizations
array.However if you try to send this email, you get the following error
To work around this issue we began explicitly adding the
to
email to thePersonalization
object before adding the BCC like soAnd the output of
mail.to_json
Notice there are now TWO entries in the
Personalization
array, and each one specifies ato
email.This request does succeed
The Issue
We opened a support case with the SendGrid team. We were told in no uncertain terms by a support rep named Anthony that the duplicate
to
fields were causing multiple copies of the email to be sent from one API request.However, in our experience we only see the issue with duplicate emails intermittently, even for identical request bodies.
When we asked about the intermittent nature of our experience we were told that support does not review code and the same "resolution" was repeated in different words blaming our code generation for the issue.
If the multiple
to
fields are truly the issue, it's a serious bug in the SendGrid client library that the first code example that generates a singleto
array in the Personalizations object is not accepted.Technical details:
The text was updated successfully, but these errors were encountered: