You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Calling add_bcc after creating a mail intance fails. #507
When I create a Mail.new and this instance includes the to property.
I will get the following error when trying to call, add_bcc
emailclientrespondedwith: -- {:response=>#<SendGrid::Response:0x0000000121b09b50 @status_code="400", @body="{\"errors\":[{\"message\":\"The to array is required for all personalization objects, and must have at least one email object with a valid email address.\",\"field\":\"personalizations.1.to\",\"help\":\"http://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/errors.html#message.personalizations.to\"}]}", @headers={"server"=>["nginx"], "date"=>["Fri, 26 Sep 2025 16:24:27 GMT"], "content-type"=>["application/json"], "content-length"=>["288"], "connection"=>["close"], "access-control-allow-origin"=>["https://sendgrid.api-docs.io"], "access-control-allow-methods"=>["POST"], "access-control-allow-headers"=>["Authorization, Content-Type, On-behalf-of, x-sg-elas-acl"], "access-control-max-age"=>["600"], "x-no-cors-reason"=>["https://sendgrid.com/docs/Classroom/Basics/API/cors.html"], "strict-transport-security"=>["max-age=31536000; includeSubDomains"], "content-security-policy"=>["frame-ancestors 'none'"], "cache-control"=>["no-cache"], "x-content-type-options"=>["no-sniff"], "referrer-policy"=>["strict-origin-when-cross-origin"]}>}
This happens when you try to call add_bcc to an mail instance, after having added a to parameter when building an email...
I found a work around by calling .add_to as part of personalization..
by including add_to as part of the personalization
Activity