Skip to content
This repository has been archived by the owner on Sep 25, 2020. It is now read-only.

bakakaba/mailer

Repository files navigation

Mailer

Setup

  1. Sign-up to Sendgrid and Mailgun.

    • Get Sendgrid API key
    • Get Mailgun sender domain
    • Get Mailgun API key
  2. Ensure AWS CLI is installed and configured to your account.

  3. Install Serverless npm install -g serverless

  4. Update serverless.yml with your credentials from step 1.

  5. Run serverless deploy

  6. Enjoy!

Consumption

To send an email, make a POST request to the endpoint that you've deployed with a JSON payload.

  • Example endpoint https://<random>.execute-api.us-west-2.amazonaws.com/dev/mailer/send

  • Email object model

    {
        "to": [{
            "name": "<string>",
            "email": "<email>"
        }],
        "cc": [{
            "name": "<string>",
            "email": "<email>"
        }],
        "bcc": [{
            "name": "<string>",
            "email": "<email>"
        }],
        "from": {
            "name": "<string>",
            "email": "<email>"
        },
        "subject": "<string>",
        "body": "<string>"
    }

TODO

  • Audit logging
    • Allows tracing and auditing of when a mail is sent
  • Tests for connectors
  • Integration tests
  • DKIM Signing
  • Spam score reduction
  • Traffic shaping
    • May want to load balance instead of just falling back
    • May want to split traffic by recipient domain for better delivery rate
  • Queue interface
    • Backoff retries for free
    • Discard time sensitive mail that are marked with a flag

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published