llc381
llc381

Reputation: 101

Send Grid - Cancel Scheduled Emails

SendGrid allows for cancelling scheduled transactional emails. This is done using a batchId attached to each email that is in the same "batch". There is a 10 batch limit and also a 10 pending cancellations limit in SendGrid. From testing, it appears the pending cancellation stays pending until the emails SendAt has come and gone. SendAt can be set up to 72 hours in advance. So, a batch can hold on to a pending cancellation for the same 72 hours.

SendGrid's campaign services allow for much more flexibility in cancelling, but appears to require that we maintain a contact list at SendGrid. That makes campaigns a no-go for us as we do not want to sync contacts from our system to SendGrid.

We need to allow unlimited cancellations. We cannot find anything in SendGrid docs about deleting transactional emails or updating the SendAt date. Either of those features would allow us to do what we are trying to do.

Can someone point me to a solution for being able to delete emails with the same batchId, updating SendAt for emails with the same batchId, or getting around the 10 batch / 10 pending cancellations limit without having to use campaigns? We are open to moving from SendGrid as well, if that is the solution.

Upvotes: 2

Views: 749

Answers (1)

jacobmovingfwd
jacobmovingfwd

Reputation: 2273

At SendGrid, you can have an unlimited number of Batch IDs generated, and in use. You can only have 10 of them in a pause or cancel state. You should keep track of the max send_at value for each batch, and if a batch is Cancelled, then you can delete the cancel state from the 10-limit once that time (and a little wiggle room) has passed, freeing up one of those 10 slots.

If you have a lot of adjustments & cancellations, I think it's best to stash your messages on your side, allow them to be edited & updated, and only send them up to SendGrid a few minutes/hours before their scheduled send time. That will hopefully prevent you from needing to have more than 10 batches in a paused or canceled state since there will be a limited time the messages will be queued up at SendGrid.

Upvotes: 1

Related Questions