Usage
Response Format
SDK Response format
Shootmail SDK exports a response type ShootmailResponse
that has following structure
type ShootmailResponse = {
status: number;
error: {
message: string;
} | null;
data: {
requestId: string
}
}
- Status can be either
200
or400
, depending on if the response is a success or an error. - If the response is successful,
error
isnull
, status is200
and the data property contains the response returned by the email provider. - If the response has error, the
data
property will be null, status will be400
and theerror
property will contain the error returned by the email provider.
Success Response
{
"data": {
"requestId": "cea768fb-cc4e-4fca-aa04-07000ee3b6bc"
},
"status": 200,
"error": null
}
Save this requestId
somewhere, this can be used to undo a scheduled message.
Error Response
{
"data": null,
"status": 400,
"error": {
"message": "The mail.mystorebud.com domain is not verified. Please, add and verify your domain on https://resend.com/domains"
}
}