mailjet / MailjetSwiftMailer

A SwiftMailer transport implementation for Mailjet
MIT License
26 stars 23 forks source link

Error when using format v3.1 and reply-To adress without a name #26

Open ghusse opened 5 years ago

ghusse commented 5 years ago

I tried to use the message format v3.1 because it allows a beter handling of cc & bcc addresses. However, when switching my code from v3 to v3.1, the mailjet API returns me an error:

{"ErrorIdentifier":"caac57f0-5f98-4d52-8c8b-f606caefd1ce","ErrorCode":"send-0018","StatusCode":400,"ErrorMessage":"Property value cannot be null.","ErrorRelatedTo":["ReplyTo.Name"]}

If I look at the code, it seems that MailjetSwiftMailer tests if the replyTo obtained from the message is an array or not, and does not test if the name is empty or not before setting it.

It also seems that swift always provides an array, even if the message contains only one address.