Mailersend integration failing on The cc.0.email field is required

I’ve configured a mailersend integration during the onboarding. We have a Premium mailersend plan, and the domain is verified.

When attempting to send a notification through Mail, the request fail. In Logs in Courier I can see the error response:

    "data": {
      "message": "The cc.0.email field is required. (and 1 more error)",
      "errors": {
        "cc.0.email": [
          "The cc.0.email field is required."
        ],
        "bcc.0.email": [
          "The bcc.0.email field is required."
        ]
      }
    },
    "status": 422,
    "statusText": "Unprocessable Entity",

Also in the request, this is what Courier is trying to send:

      "data": "{
\"from\":{\"email\":\"automat@mydomain.com\"},
\"to\":[{\"email\":\"martin.janecek@mydomain.com\"}],
\"bcc\":[{}],
\"cc\":[{}],
\"reply_to\":{},
\"subject\":\"Welcome to Courier!\",
\"text\":\"Want to hear a joke? How did the T-Rex feel after a set of bicep curls? Dino-sore!\",
\"html\":\"redacted\"}",

For some reason, Courier is adding an empty object to cc and bcc arrays.

Hi @martin.janecek :wave:

I believe I’ve run into this issue before with someone else using Mailersend. When trying to debug, I spoke to MailerSend’s support team, and they said the following:

MailerSend requires the ‘bcc’ and ‘cc’ fields to be populated for their endpoint to deliver a successful message. It’s worth noting that the bcc and cc fields cannot be the same as the recipient, and the reply-to has to be your verified email domain otherwise, your request will fail.

Hi @rodrigo, thanks for the reply!

The cc and bcc fields themselves aren’t required. Only when populated, then it has to include email.

So bcc: [] would be valid, no bcc too, but bcc: [{}] isn’t (the element doesn’t include email).

Even if I wanted to provide bcc and cc, I don’t know how I would do that within the Courier interface.