dwyl / dwyl/auth

Feat: Use `Gmail` to send Email!! 📧 🤯

Open
#271 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Elixir
Stars
141
Forks
8
PR merge metrics
No merged PRs in 30d

Description

It recently occurred to me while reading the `swoosh` Adapters docs: https://hexdocs.pm/swoosh/Swoosh.Adapters.Gmail.html#content 👀
That I'm over-thinking/complicating things by using `AWS SES` for sending emails ... 💭

My _original_ reasoning for using `SES` is/was simple:
1. A dedicated purpose-built transactional email system that has bounce/failure detection.
2. Cheapest by _far_ and with a generous "free tier" means we can send **`62k emails / month`** for ***FREE*** before paying a penny ... see: https://aws.amazon.com/ses/pricing/
3. Fully customisable and usable from `AWS Lambda`, again "free tier".

These reasons are still technically valid. But they miss one important fact: **_setup_ complexity**!!
We ended up needing a whole separate repo for this: https://github.com/dwyl/aws-ses-lambda
Which we considered _reasonably_ well-documented/maintained ...
But doesn't have an `AWS CloudFormation` script to _automate_ the setup ...
so it's still a _manual_ process with several steps.

**What `if`** there was a **_dramatically_ simpler way** of doing this?
**What `if`** when setting up the `auth` app for the first time, the `admin` person
was able to sign-in with their `Google` Account e.g. `hello@app.io`
and then the `auth` app stored a token to send emails on behalf of the `admin` using their `Gmail`?!
This would solve _so_ many issues in one step!

# Simplified Setup

Consider the list of environment variables on the current `/init` screen: https://authdemo.fly.dev/init

image

1. The `ADMIN_EMAIL` would be populated by this step
so we would _never_ see the error described in #270
2. `EMAIL_APP_URL` would no longer be needed, i.e. no longer a _separate_ app! ref: https://github.com/dwyl/email/issues/77

# Enhanced Deliverability

Instead of having to waste time setting up all the enhanced verifications in a **3rd** party email service,
Google handles the deliverability!!

## Replies!!

If people receiving an email from our `App` want to _reply_ they can, easily!
And that reply ends up in our collective inbox. Not in the `AWS SES` black hole.

# Limitations?

Google has a daily sending limit of **`500`** emails.

https://www.google.com/search?q=gmail+outbound+sending+limit+daily
image

This is totally fine during `MVP`, we _definitely_ won't have more than **`500`** signups per day.
For reference, this is **`15,000/month`** ... any bootstrapped startup would _dream_ of this!!
But what happens on a day that our `App` is mentioned on `HackerNews`, `ProductHunt`, `Reddit` or `YouTube`...?
Well, we build a "**waiting list**" feature https://github.com/dwyl/app/issues/304 that would store all the details and send the emails as soon as resources were available.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.