#Messaging via Resend: "to": "\"undisclosed-recipients\": ;" in request body

6 messages · Page 1 of 1 (latest)

burnt cypress
#

I'm using the [email protected] SDK.

await messaging.createEmail({
        messageId: ID.unique(),
        subject: "Subject",
        content: `htmlContent`,
        users: [recipientUserId],
        draft: false,
        html: true,
      });

I can see in the console that this is received and the correct user is picked along with their default email target, but Resend always rejects this with status 422:

{
    "name": "validation_error",
    "message": "Invalid `to` field. The email address needs to follow the `[email protected]` or `Name <[email protected]>` format.",
    "statusCode": 422
}

In the request body, the bcc field is showing the actual correct email address, whereas the "to" field is showing a weird escaped phrase:

{
    "bcc": ["(this is correct)"],
    "to": "\"undisclosed-recipients\": ;"
}
digital pebble
#

@burnt cypress which email adapter are you using?

#

oh Resend

#

maybe resend doesnt support undisclosed-recipients 🤔

burnt cypress
#

Ah, possibly. But there was an article posted on the AppWrite blog announcing support of Resend via the SMTP adapter, and this was only a short while ago, so I'm not sure what the problem might be?

It doesn't look like there's any configuration to change the format of the request body in AppWrite (nor how it's interpreted in Resend).