Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Feature: Admin Mailer / Email support #83

Open
scosman opened this issue Jun 5, 2024 · 2 comments
Open

New Feature: Admin Mailer / Email support #83

scosman opened this issue Jun 5, 2024 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@scosman
Copy link
Contributor

scosman commented Jun 5, 2024

Adding this as a new feature I think we need if anyone wants to take a run at a PR.

Basically: a way for a site owner to get an email when important things happen (contact us form, sign up, purchase). I added this in my private fork and it's super helpful. However, not happy with my library choice, so I'd want a cleaner version here.

Part 1: Mailer

A typescript file that can send emails to the website owner. Basically expose sendAdminsEmail(subject, html_body). No opt if the user hasn't set up correct env configs.

  • Env config with SMTP creds
  • Env config with "from/to" email addresses
  • Probably should use: https://nodemailer.com

I built this into my own fork, but made the mistake of using AWS SES APIs which are overly complex and host specific. SMTP crews and node mailer are way more flexible.

Part 2: Integrate into key places in the app

Add integrations into places where the site admin might want to be notified:

  • Contact us
  • Sign up
  • Create profile
  • Purchases
  • Delete account

Also add env var for admin_emails. Defaults to all, but you can override it in env to only get a subset of these.

Part 3: Docs

Document the env vars and integration above in the README

@scosman scosman added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Jun 5, 2024
@scosman scosman changed the title New Feature: Mailer / Email support New Feature: Admin Mailer / Email support Jun 5, 2024
@MaxBroome
Copy link

I already have some of this functionality with Supabase and webbooks. Whenever a new row is inserted into the contact_request table, it makes a webhook to a Python API I made that sends an email to me via SMTP that includes the form data with some formatting to make it look pretty.

I think including that feature in this repo would be sick. I'll take a look at it and maybe give it a shot!

@scosman
Copy link
Contributor Author

scosman commented Jun 6, 2024

Very cool!

Would love to just include it in the actual codebase (aka, the POST call for contract form), over a DB hook. Some folks are working on this with a non-Supabase Postgres. Would like to try to keep new features more pure Node/SMTP/Svelte, and less host specific code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants