GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - nilbus/email-diff: Forward emails to email-diff, and it will reply with differences highlighted

This repository was archived by the owner on Jan 20, 2021. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

3 Commits
3 Commits

Folders and files

NameName
Last commit message
Last commit date
.bundle
.bundle
 
 
lib
lib
 
 
node_modules
node_modules
 
 
spec
spec
 
 
vendor
vendor
 
 
.gitignore
.gitignore
 
 
.rspec
.rspec
 
 
.rubocop.yml
.rubocop.yml
 
 
.tool-versions
.tool-versions
 
 
Gemfile
Gemfile
 
 
Gemfile.lock
Gemfile.lock
 
 
Guardfile
Guardfile
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
Rakefile
Rakefile
 
 
email_diff.rb
email_diff.rb
 
 
package-lock.json
package-lock.json
 
 
serverless.yml
serverless.yml
 
 

Repository files navigation

email-diff

Get weekly newsletters that only differ slightly, e.g. with a list of upcoming events? Forward your emails to email-diff, and it will reply with differences highlighted.

As of Jan 2020, this service runs well within the perpetually-free tiers of the hosting services it uses.

Dependencies

  • email-diff is a Serverless Framework app, powered by AWS Lambda.
  • The serverless database FaunaDB stores a copy of the last email it received.
  • Mailgun sends and receives emails.

Initial Setup

AWS

  1. Create an AWS account: https://aws.amazon.com/
  2. Create credentials and config files per the docs.

Serverless

  1. Create a serverless.com account.

  2. Install the Serverless client, and log in

     npm install -g serverless
     npm install --save-dev serverless-ruby-package
    
     sls login
    
  3. Customize serverless.yml to suit your needs. The AWS provider region should match the region specified in AWS config file.

  4. Deploy, and note the function endpoint URL (ends with /email-diff/{id}).

     sls deploy
    

FYI: The ruby runtime is not currently supported by the Serverless Dashboard (monitoring).

Mailgun

  1. Create a mailgun.com account
  2. Enter a credit card to use the free plan without limitations on recipients and domains.
  3. (Optional) On the dashboard, set up an MX on a subdomain as a sending domain. Alternatively, use the free sandbox subdomain provided by Mailgun.
  4. Add a Receiving route for each recurring email you'd like to compare (e.g. 1 for each newsletter series).
    • Expression type: match recipient
    • Recipient type: (make up an email address that uses your sending domain)
    • Forward: (checked) Paste the endpoint URL from the serverless deployment, replacing {id} with a custom identifier (alphanumeric with dashes or underscores) corresponding to the email series being compared.
    • Store and notify: (not checked)
    • Stop: (checked)
  5. Set MAILGUN_DOMAIN and MAILGUN_API_KEY in your environment to the appropriate values.

Fauna DB

  1. Create a fauna.com account.
  2. From the dashboard, create a new database with name email-diff (or customize via ENV var FAUNA_DB_NAME).
  3. Create a new collection with name email_version, with no TTL. Do Create collection index.
  4. Under Security, Create a new key. Use Role: Server, Key Name: email-diff
  5. Set FAUNA_DB_KEY in your environment to the key's secret value.

Sentry error tracking

(optional)

  1. Create a sentry.io account.
  2. Create a new Ruby project
  3. Set SENTRY_DSN in your environment to your project's DSN configuration value.

Configuration

Have these variables set in your environment when deploying

  • FROM_EMAIL: sending email address on sending domain
  • RECIPIENTS: comma-separated email addresses, optionally in the form Sender Name <[email protected]>, [email protected]

Environment variable summary

  • FROM_EMAIL
  • MAILGUN_DOMAIN
  • MAILGUN_API_KEY
  • FAUNA_DB_KEY
  • RECIPIENTS
  • SENTRY_DSN

Development

Install Ruby dependencies:

bundle install --standalone

Test integration locally:

rake test:integrated

Test on remote server:

sls invoke -f email-diff

About

Forward emails to email-diff, and it will reply with differences highlighted

Resources

Readme
MIT license
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.