Install
pip install django-ses-gateway
Things To Do Before Integration:
AWS_ACCESS_KEY_ID = "Your AWS Access Key"
AWS_SECRET_ACCESS_KEY = "Your AWS Secret Key"
2.To use Amazon SES as your email receiver, you must create at least one active receipt rule set in which you have specified the sns topic(to route messages to an endpoint), s3 bucket(to store messages), lamda function(to process the receiving email) details.
How amazon ses performs email receiving:
Usage:
1. Sending an email
from django_ses_gateway.receiving_mail import sending_mail
sending_mail(subject, email_template_name, context, from_email, to_email)
Here we are sending a from_mail as <unique-identifier>@yourdomain.com. Here unique identifier will be used to process the reply to this mail.
2. Receiving an email
from django_ses_gateway.receiving_mail import sns_notification
subject, from_mail, to_mail, hash_code, mail_content = sns_notification(request.body)
Using the unique identifier(hash_code), we can easily process or store the incoming messages.
It will process your message content, will return the email subject, from mail, to email([email protected]), hashcode(abc) or unique-identifier, mail content.
You can view the complete documentation here. http://django-ses-gateway.readthedocs.io/en/latest/
Github Repository: https://github.com/MicroPyramid/django-ses-gateway