sendgrid/smtpapi-nodejs

Sending email's with generated batch_id not working

Closed this issue · 1 comments

Hello,

I am creating a batch id using https://api.sendgrid.com/v3/mail/batch and it is returning a valid batch_id.

I am then sending a message with batch_id:
...
msg.batch_id = batch_id;
msg.send_at = [FUTUREDATE]
await sgMail.send(msg);
...

After sending, If I then try to validate the batch_id with /mail/batch/{batch_id}, it does validate.

However, if I try /user/scheduled_sends and it returns an empty array. If I try and cancel running: https://api.sendgrid.com/v3/user/scheduled_sends/{batch_id} it returns:
{
"errors": [
{
"field": null,
"message": "batch id not found"
}
]
}

The email is sent at the time it is scheduled to go out, but because I can't validate the batch_id, I am unable to cancel or pause.

Am I missing something, or does this seem like the correct way to handle this.

I have updated to the latest package: @sendgrid/mail: ^7.4.2,

Thanks!