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

Email template publishing infrastructure #2

Open
leigh-johnson opened this issue Nov 1, 2022 · 0 comments
Open

Email template publishing infrastructure #2

leigh-johnson opened this issue Nov 1, 2022 · 0 comments

Comments

@leigh-johnson
Copy link
Member

Emails are by far the most effective form of outreach/marketing, but right now the process for publishing PrintNanny emails is manual.

Current Process

Step 1: Build Maizzle email template

Run npm install && npm build` in printnanny-maizzle (this repo)

This outputs an email .html to build_production/ with in-lined CSS/table styles.

Step 2: Upload HTML file to Mailgun templates

I currently do this via Mailgun's UI.

Step 3: Upload images to cdn.printnanny.ai

cdn.printnanny.ai is backed by a GCP Storage bucket, so this is done via gsutil cp

Step 4: Send a test email

I currently use curl for testing

$curl -s --user '<token>' \
         https://api.mailgun.net/v3/mail.printnanny.ai/messages \
         -F from='PrintNanny <[email protected]>' \
         -F to='Leigh Johnson <[email protected]>' \
         -F h:Reply-To='[email protected]' \
         -F subject="[PrintNanny] You're invited to the Founding Member program" \
         -F template='founding-member-november-v2' \
         -F h:X-Mailgun-Variables='{"name": "Leigh"}'

Step 5: add email_campaign row to production

I currently use Django's fixtures to check the row into source control, which can then be loaded into the production database via python3 manage.py loaddata <json file>
https://github.com/bitsy-ai/printnanny-webapp/blob/main/print_nanny_webapp/email_campaigns/fixtures/email_campaigns.json

Ideal Process

When new revisions are merged to printnanny-maizzle, do the following:

  1. Build email template html
  2. Update or create template via Mailgun's API: https://documentation.mailgun.com/en/latest/api-templates.html
  3. Send a test email (include version info in the footer if possible)
  4. PROMOTE BUILD step: POST printnanny.ai/api/email-campaigns/update-or-create
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant