Skip to content

This is a simple application to grab an email from you gmail inbox, edit it, then send it to the Amazon Simple Email Service for mass distribution.

Notifications You must be signed in to change notification settings

fabie37/Email-Relay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gmail to Amazon SES Relay

What is this?

This is a simple application to grab an email from you gmail inbox, edit it, then send it to the Amazon Simple Email Service for mass distribution.

How does it work?

Couldn't be easier! All that is needed is an gmail application access key and an amazon ses key. Once you have them, you can read from your gmail inbox, edit an email and send it off to a client list.

Required Permissions

Example of gmail_client_secret.json

This should be automatically created by the google api console. Just download it. This is an example of a desktop application.

{"installed":
    {"client_id":"YOUR CLIENT ID",
    "project_id":"YOUR_PROJECT_ID",
    "auth_uri":"https://accounts.google.com/o/oauth2/auth",
    "token_uri":"https://oauth2.googleapis.com/token",
    "auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs",
    "client_secret":"YOUR_SECRET",
    "redirect_uris":["http://localhost"]}
}

Example of aws_credentials.csv

This should be automatically generated by AWS SES portal. Just download it. This is an example of what it should look like.

IAM user name,SMTP user name,SMTP password
test_user,ABCDEFG12345678910ABC,ABCDEF1234567890ABCDEF1234567890ABCDEF12345678

Usage

Read an email, edit it and bulk send to client list:

from gmailrelay import Relay

# API Access Keys & Config Files
gmail_secret_filename = "gmail_client_secret.json"
aws_credentials = "aws_credentials.csv"
aws_config = "aws_config.json"

# The from address your clients will see
sender = "you@example.com"

client_list = ["a@mail.com", "b@mail.com"...]

relay = Relay(gmail_secret_filename, aws_config, aws_credentials)

email = relay.get_first_unread_email("sender@mail.com")
relay.match_and_replace(email, "REGULAR_EXPRESSION", "TEXT_TO_INSERT")

relay.send(sender, client_list, email)

About

This is a simple application to grab an email from you gmail inbox, edit it, then send it to the Amazon Simple Email Service for mass distribution.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages