Skip to content
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

ENH: Add support for relaying emails via boto3 for use cases where apps running in AWS use IAM policies to authenticate against SES #86

Open
devraj opened this issue Oct 4, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@devraj
Copy link

devraj commented Oct 4, 2023

Is your feature request related to a problem? Please describe.
Whilst Amazon SES offers relaying emails via SMTP there are cases where the environment is configured to use IAM policies for authentication. This applies to services like S3 for file storage or SES for email relay.

In these use cases the application would simply instantiate the boto3 client as:

import boto3
ses_client = boto3.client("ses", regional_name="ap-southeast-2")

and use their send_email function to send the message without the need of authenticating.

Describe the solution you'd like
If it's amicable with the design of this project then I would like to be able to initialise EmailSender with preconfigure boto3 client no different to how we can pass a custom SMTP instance.

import boto3
ses_client = boto3.client("ses", regional_name="ap-southeast-2")

sender = EmailSender(boto3_client=ses_client)

the send function would then use the boto3 client instead of an SMTP server to relay the emails.This way we get the array of functionality (namely templating) that this library offers and integrate into a platform like AWS.

Describe alternatives you've considered
At the moment our only alternative is to render Jinja templates on our own and then relay messages via boto3.

Additional context
This may be relevant to other cloud services like GCP or Azure. We've been working with the lovely folk @resendlabs who maintain a Python idiomatic SDK and could see this as an enhancement.

I would personally be willing to work on the boto3 and resend integration and provide a pull request :)

@devraj devraj added the enhancement New feature or request label Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant