GithubHelp home page GithubHelp logo

saiorama / ses-email-client Goto Github PK

View Code? Open in Web Editor NEW
27.0 2.0 10.0 11.33 MB

Simple, serverless client for AWS SES. With this, you can send/read emails received by SES into S3 without purchasing AWS Workmail. If you only use SES for email marketing, you can also see and preview your SES templates in the browser

License: MIT License

HTML 65.62% JavaScript 18.57% Shell 0.19% CSS 15.62%
aws lambda nodejs vuejs2 serverless email-client cognito s3 aws-ses ses-templates

ses-email-client's Introduction

As of 18-NOV-2021, this repository is no longer actively supported. Here's my other repo which can be used as an AWS SES client for your domain.

DEPRECATION - This project is getting sunsetted soon. See above for link to my other similar project.

======================

This project aims to make it a bit easier to work with AWS SES (Simple Email Service). For technical details, scroll to the bottom of this page.

# Why do we need this?

You can look at AWS SES in two ways -

## SES for Marketing One, SES is a transactional email service. You can use it to run marketing campaigns and broadcast messages to people interested in hearing from you. A vast majority of SES customers use SES this way. This use of SES is similar to using Mailchimp or SendGrid.

To be most effective, emails must to look good and should be built for scale. This is where email templates come in. You design a beautiful email, then convert it into a template by adding placeholders for customer specific data and thus, achieve email at scale.

The other aspect of using SES this way is that you would like to know how your broadcast message did. How many people saw it? How many interacted with it? Did some emails bounce or were they all delivered? Are people complaining about receiving spam from you?

Such performance metrics are the backbone of any transactional email service.

Unfortunately, SES has very mediocre offerings for templating and viewing marketing performance. For example, it is not possible to preview your email templates in SES. Neither can you test your email with some dummy data to see how the email looks.

### What can this project do right now? With this project, I have tried to make it easier for SES customers to view their templates, find template placeholders, and preview it right in the browser without having to send themselves emails.

I have also surfaced some basic stats about your email campaigns - how many emails were sent? Any bounces? Any complaints? Little things like that. If you have other gripes about transactional SES, let me know by raising an issue.

## SES as your inbox

The other,less common use case for SES is as your personal inbox or as a mail provider for your company. Note that SES itself does NOT provide any help to achieve this. They don't even give us a mail server from where we can download our emails. Projects like this (Arithmetric) allow you to use SES to send and receive SES emails in Gmail or any other mail client.

~While such tools exist, I am building this project to be truly self contained. I don't want to use a third party client like Gmail to send and receive email. This tool is fully serverless and runs only on the user's browser from where it interacts with AWS to retrieve emails (from S3) and ~

### What can this project do right now?

Right now, I can do the following things with this client:

1. sort received emails by date and time 2. authenticate the user using AWS Cognito. Force log in if the user is not logged in. 3. retrieve the list of emails received today and yesterday 4. retrieve the content of each email from S3 5. convert the raw email into human readable pretty HTML or Text 6. highlight emails as SPAM or containing a virus 7. show user email content 8. reply-all to everyone in TO and CC. Write rich text using markdown. 9. auto-populate the FROM address depending on the domain 10. compose new rich text (markdown) emails 11. get a shareable link for email

My goal is to have a fully functional email client running directly on SES and S3 without having to resort to lambda forwarders or using Gmail as an SMTP client.

### Future plans for SES as my inbox?

I want to build a commenting system around email to make emails more collaborative.

# Technical Details

The demo site for seeing your SES templates, testing out SES templates in your browser, and generally using SES as a marketing tool is at https://zeer0.com/templates

If you want to build your own SES email client, you are welcome to fork this project. 1. to learn how I sort emails by time and date to allow easy retrieval, look at the lambdas directory 2. follow any online tutorials on using Cognito 3. look at this lambda to understand how I retrieve an email's content 4. look at this lambda to understand how I retrieve an email list 5. the javascript inside my-email/index.html handles Cognito, spam/virus highlighting 6. composing rich text/markdown emails is handled using stackedit.io

One thing to note is that my email client makes some assumptions about the location of my S3 bucket and the key path where my received emails reside. Therefore, this code is not truly usable until you tweak params and ensure that your emails sit in an S3 bucket under a key path that makes sense to you.

I'm happy to help anyone who wishes to use this project to build their own SES inbox.

ses-email-client's People

Contributors

nafeen avatar neelesh17 avatar saiorama avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ses-email-client's Issues

Add .js to save-eml-attachments-to-s3 file name

This is super basic issue just to work out the kinks in the issue tracking and PR process.

  1. The file needs to be renamed to include the .js extension without which GH's syntax highlighting doesn't seem to work.

Display template name on screen

After clicking on template name, the template is loaded on screen but template name is never shown on screen. Users should be shown the name of the template currently being displayed.

Sanitize codebase

MOVE the following to ENV variables -

  • domain vars
  • redirect vars
  • bucket names
  • region names
  • urls
  • keys & tokens

Support "Reply" feature directly from the emails

Right now, a user can either read the email using my-email/index.html or compose emails using the inline email editor. This means that the user can't read emails and reply to them from one window.

Improve mobile experience

  1. Add disclaimer to the templates page that this page not optimized for mobile.
  2. Use modals to show templates on desktop and mobile

If the user is on mobile, add some text indicating that it the page will look awful on mobile.
The user should be able to use the templates page

Use domain as root prefix name and subdomain as sub-prefix for downloading emails from S3

If a domain does not have subdomains, use the domain name as the root prefix name
If it has subdomains, use the subdomains in reverse order as sub-prefix inside the root prefix by replacing . with /
Ignore port numbers in domain names

Domain Root Prefix Sub-prefix
https://example example -n/a-
https://example.com example.com -n/a-
https://email.example.com example.com email
https://teamA.email.example.co.in example.co.in email/teamA
https://teamA.email.example.co.in:3737 example.co.in email/teamA

(Use Mozilla's Public Suffix List to solve the last requirement.)
--OR--
I've created an API to extract tld from a domain based on the PSL linked above.

Use the API so -
curl -H 'x-api-key: ' 'https://api.zeer0.com/v001/tools/public-suffix?domain=https://janata.in'

I'll send you the API key separately.

How is it useful?

The domain prefix is the last dot separated segment prior to the TLD. Therefore, for www.my-website.co.in, co.in is TLD, my-website is domain prefix, and www is the subdomain.

The root prefix will be my-website.co.in
The sub-prefix will be www.


How is this useful?
Once we move to this format, we can provide a cloud based shared inbox under a single domain to any user who does not already have web hosting. Say our cloud client is called shared-inbox.com. If a user wants to create a shared inbox on their personal domain - like my-domain.com - they can see their emails at com.my-domain.shared-inbox.com.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.