Mailgun : Cancel queued emails
Asked Answered
W

4

6

I am using mailgun API to send emails. By mistake I called a function that queued thousands of emails in Mailgun.

Is there a way to Cancel/Clear the queue?

Workroom answered 31/8, 2015 at 10:22 Comment(5)
As far as I know, there is no way to cancel a Mailgun queue.Mezereum
How did you solved the problem?Ardeb
@waterkinq Not able to solve itWorkroom
@NishitModi thank you for your clear answer :) Thats right. Unfortunately, I have sent 889K emails and could not do anything. As a person who does such a mistake, my suggestion is that the best way to do in such problems is to open a support ticket from Mailgun. They are purging it. you cannot do anything More.Ardeb
Mailgun has an official solution to handle this situation: https://help.mailgun.com/hc/en-us/articles/360012487654-How-can-I-delete-messages-from-the-queue-.Stipe
A
1

There does not seem to exist an easy way through the API, except contacting Mailgun Support.

On the other hand, I found a handy workaround that might work for your case: add the recipients in the Bounced Recipients temporarily (Suppressions) so when the time comes, email will not be sent and marked as failed/bounced from Mailgun.

When all of the emails you wanted disappeared are marked as bounced, you can remove recipients from bounces list.

Hope this helps

ps: I know it's an old thread but, mistakes are made all the time ;)

Alidus answered 23/6, 2017 at 5:44 Comment(0)
F
0

If I've sent an email to 150 recipients to the mailgun servers and used BatchMessage and setDeliveryTime() to schedule it for the next day at 7 AM, there's currently no way to cancel this message if I decide later, before the set time, to cancel the job.

This could be fixed by getting a return hash value when using finalize() which then could be used with a new function deleteMessageQueue(return hash value) that will cancel the job.

The canceled message still counts the email credits used, of course.

Festoonery answered 18/4, 2016 at 4:59 Comment(0)
H
0

rather than Bouncing the address, you can tag your emails and then just unsubscribe the address from the specific tag.

Hagen answered 16/8, 2017 at 11:54 Comment(0)
M
0

It's 2024 and you can purge the queue, look at MailGun API documentation

I have been calling this API endpoint like below:

curl -i -X DELETE --user 'api:<api key>' https://storage-us-east4.api.mailgun.net/v3/mail.superbly.cloud/envelopes

storage-us-east4.api.mailgun.net is address that depends on your region.

Manifold answered 8/5, 2024 at 15:32 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.