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?

Nishit Modi
  • 175
  • 1
  • 18
  • As far as I know, there is no way to cancel a Mailgun queue. –  Aug 31 '15 at 10:37
  • How did you solved the problem? – Mehmet Kagan Kayaalp Jul 04 '16 at 09:57
  • 1
    @waterkinq Not able to solve it – Nishit Modi Jul 08 '16 at 12:23
  • @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. – Mehmet Kagan Kayaalp Jul 08 '16 at 13:27
  • 1
    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-](https://help.mailgun.com/hc/en-us/articles/360012487654-How-can-I-delete-messages-from-the-queue-). – Allen Dec 27 '18 at 09:23

4 Answers4

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 ;)

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.

0

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

moshewe
  • 127
  • 1
  • 9
0

Clearing The Queue: A Quick Primer

We'll show you how to do this below:

  • First, log in to the Mailgun Control Panel (if you have not already done so).

  • Then, within the left-hand navigation pane, click the Sending option to expand its list of suboptions.

  • Next, click the Domain settings suboption. Ensure that the domain for which you wish to clear the queue is displayed within the Domain drop-down list towards the upper-right portion of the page.

  • Near the bottom of the page, locate the Advanced section and the Clear domain queue setting.

  • Click the Clear queue button and confirm your intention to clear the queue by clicking the Clear queue button in the pop-up modal.

Here is the Reference

Jai Chauhan
  • 4,035
  • 3
  • 36
  • 62