-
-
Notifications
You must be signed in to change notification settings - Fork 664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for sending emails with resend.com #1248
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @mscno
Many thanks. This looks good, can't spot any issues with it at all :)
Implement webhook-based suppression handling for tracking bounced emails.
So in resend you need to keep track of bounced emails sent to a webhook? We can make it work that way, it's just a bit more work to track.
Improve error handling and add retries for transient failures.
Yes a retry mechanism for all email sending would be quite good to have, agreed. It might be better to take that as a separate piece of work / PR though if we did look at that.
Resend doesnt have a suppresion API like AWS so for now. So for now I just return nil and dont set any suppressed emails. The only way to make it work is to manually listen to bounce webhooks from resend and then store these somehow. Probably this is a little too much work, for what its worth. Its not strictly necessary to have the suppressed emails I think. Agreed that the retry mechanism is probably better handled in the email service level rather than on the level of each provider. |
Yeah I think I agree, there's a lot of effort there to get the bounces to be processed like the others. I think we're OK to leave this. |
Hey @mscno Ok I'm happy to bring this into main, I think the only thing we're missing here is some bit of update to the docs to let people know that resend is an option - https://github.com/getfider/fider-documentation/blob/main/docs/self-hosted/hosting-instance.mdx |
added here |
#1247
This PR introduces support for Resend.com as an email provider, alongside existing AWS SES and Mailgun implementations. It allows users to configure Resend as their email service and send emails using Resend’s API.
Changes Introduced
• Added a new resend package implementing the email.Service interface.
• Integrated Resend Go SDK (github.com/resend/resend-go/v2) for email sending.
• Implemented sendMail function to send emails via Resend.
• Added basic tagging support (template and tenant tags) for tracking emails.
• Registered the service via bus.Register(Service{}), allowing dynamic configuration.
• Stubbed out fetchRecentSuppressions, as Resend does not provide an API for fetching suppressed addresses directly.
Implementation Details
• Uses resend.NewClient to initialize the Resend API client.
• Emails are sent with a subject, HTML body, and recipient list.
• Logs debug messages for email sending and failures.
• Handles missing sender/recipient addresses and ensures emails can be sent.
Next Steps
• Implement webhook-based suppression handling for tracking bounced emails.
• Improve error handling and add retries for transient failures.
Why This Change?
This change expands email provider support, allowing users to choose Resend as a more developer-friendly and modern alternative to AWS SES or Mailgun.