Skip to content
Back

Not sending to majority of Topic Targets with Mailgun API

  • 0
  • 4
  • Messaging
  • Cloud
mountain/\ash
17 Aug, 2025, 12:39

I have a site using Appwrite Cloud with many people joined with email, Google/Facebook/or Apple Auth. I’ve added them (156 people) to a Messaging Topic and have Mailgun API setup as a provider. I’ve sent twice to this list over the last month and not seen a traffic spike shortly after as you normally would. I’ve just logged into Mailgun to discover that the MG stats show that Appwrite API is only requesting email sends to 33 addresses (about 123 missing) - in both times email sends were triggered from the AW web console. Is there somekind of limitation on th number of emails that the AW free plan puts on messaging?

TL;DR
Issue with sending emails to multiple recipients using Mailgun API via Appwrite. Mailgun shows only a portion of recipients as accepted, suspecting rate limiting. Suggested solution includes investigating issue between Appwrite and Mailgun integration, possible use of wrong API to send emails, and checking Mailgun API headers for rate limits. Raised the issue on GitHub for further investigation.
18 Aug, 2025, 14:45

<@501784879638249472> are you familiar with this issue?

18 Aug, 2025, 14:49

We don't put any such limits as per my knowledge.

<@462046107556511744> have we come across this in the past?

19 Aug, 2025, 01:26

Nope

26 Dec, 2025, 12:28

Again (4 months later - I don't send emails often)... this issue seems to still be occurring. To add more context, as I believe the debugging will need to occur on the Appwrite cloud side; I created the Message (email) from within the AW Web UI - not using an API or SDK. I created a "topic" with 89 users/targets and sent the email "now", but on the Mailgun (free account) side, it's showing in the logs only 24 "accepted" logs... which then duplicate in the logs with a "delivered: ok" log. It would appear that either AW isn't sending all the requests to send an email, or Mailgun is dropping them (maybe some type of API rate limiting). Is their logging on the AW Cloud side to show when the requests to Mailgun fail? Is AW using the best API to batch send an email with multiple recipients to Mailgun? (it would appear to me that AW is looping the API calls/hammering the Mailgun endpoint servers).

27 Dec, 2025, 01:19

My 2nd scheduled email just sent and it too capped out at 25 recipients in Mailgun but shows 120 in Appwrite. Definitely something wrong with the integration between the two services here. <@462046107556511744> or <@501784879638249472> could you please investigate? (Note: this is different from my initial hypothesis - I think the cap is now a "rate limit" on the Mailgun side, but Appwrites integration should be taking care of this, both in rate delay/better endpoint use and logging so you can see the failures.

🐛 My guess is that AW is calling the https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/messages/post-v3--domain-name--messages for each "target" instead of making all the targets into an array and sending in the "to" value of the MG API.

27 Dec, 2025, 02:09

To help with debugging; it seems the MG API will include headers about the rate limits. https://documentation.mailgun.com/docs/mailgun/api-reference/api-overview#rate-limit-headers

27 Dec, 2025, 05:10

I've looked through the AW source code, but fear this could be a big recator in the way emails are sent (from individual STMP requests to per provider API requests). I've raised the issue on GitHub: https://github.com/appwrite/appwrite/issues/11023

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more