Repository navigation
Description
👟 Reproduction steps
After you've previously setup Mailgun as a Messaging Provider;
- Go to AW Cloud
- Click on Messaging
- Create an email to many (30+) email targets/recipients
- Send the email now (or at another time)
Appwrite (AW) will show that the email has been sent to all recipients, while Mailgun (MG) logs will show that only 20-25 requests to send an email were logged.
Originally raised at https://discord.com/channels/564160730845151244/1406618445491212389 and refined in https://discord.com/channels/564160730845151244/1406618445491212389/1454088484900966533 & https://discord.com/channels/564160730845151244/1406618445491212389/1454282386282905743
It would appear that either AW isn't sending all the requests [individually] 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).
👍 Expected behavior
- email request passed to MG in one API call
- request status shown in AW UI
When MG is setup in the AW web UI with an API key, I'd expect that the API is being used (not SMTP), as such the API allows for an array of recipients to be specified.
Possible pointers for Contributors
From a quick search of the codebase, it would seem that changes would need to be made in these to files to be able to handle recipients as an array when using a service provider (not SMTP).
appwrite/src/Appwrite/Event/Mail.php
Line 9 in b03aa8d
protected string $recipient = ''; $recipient = $payload['recipient'];
Information about MG rate limiting responses: https://discord.com/channels/564160730845151244/1406618445491212389/1454295163525529651
🎲 Appwrite version
Version 1.8.x
🧱 Your Environment
- Mailgun
Activity
coderabbitai commentedon Dec 27, 2025
📝 CodeRabbit Plan Mode
Generate an implementation plan and prompts that you can use with your favorite coding agent.
Examples
🔗 Similar Issues
Related Issues
👤 Suggested Assignees
🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
Update Mails.php
feat: add batch recipient support to Mail event class
feat: add batch recipient support to Mail event class
ooye-sanket commentedon Dec 30, 2025
Hi team!
Just opened a PR to fix issue #11023 (Mailgun rate limiting when sending to 30+ recipients): #11042 The fix implements batch sending using BCC, reducing 30+ API calls to just 1 call while maintaining full backward compatibility.
@mountainash - This should solve your issue! @sesam @brandonroberts @tomer @SoftCreatR - Would love a review when possible
Thanks!
mountainash commentedon Dec 30, 2025
Great work @ooye-sanket. I think the is will also solve a #10474 as well?
ooye-sanket commentedon Dec 30, 2025
yes! this PR Partially Solves This Issue Too!
mountainash commentedon Jan 15, 2026
It's a bit disheartening to see that @ooye-sanket jumped on this pretty quickly and coded up a thoughtful backwards compatible fix, to have it just get stale with no response at all.
Just letting you know @ooye-sanket that I apricate what you've done and hope that this can be merged (or responded to) by the Maintainers soon.
ooye-sanket commentedon Jan 16, 2026
Thanks a lot @mountainash really appreciate your kind words and support