Skip to content

Commit

Permalink
Merge pull request #163 from CriticalMoments/svelte_5_evlim
Browse files Browse the repository at this point in the history
Svelte 5 evlim
  • Loading branch information
scosman authored Nov 3, 2024
2 parents 29e67ec + b6de2b6 commit 0cc7b58
Show file tree
Hide file tree
Showing 33 changed files with 515 additions and 612 deletions.
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
**/package-lock.json

# Don't format plaintext email templates, the new lines are important
src/lib/emails/*_text.svelte
src/lib/emails/*_text.svelte
src/lib/emails/*_text.hbs
8 changes: 5 additions & 3 deletions email_docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ SaaS Starter includes a welcome email template that you can customize to fit you
To customize the email:

- edit the properties like company name, from email, and subject in the call to sendTemplatedEmail in src/routes/(admin)/account/api/+page.server.ts
- edit the plaintext email content in src/lib/emails/welcome_email_text.svelte
- edit the html email content in src/lib/emails/welcome_email_html.svelte - don't forget address and preheader text which won't render in a preview, but will in the client's email client.
- edit the plaintext email content in src/lib/emails/welcome_email_text.hbs
- edit the html email content in src/lib/emails/welcome_email_html.hbs - don't forget address and preheader text which won't render in a preview, but will in the client's email client.

**Note**: use triple braces for properties in plaintext emails, and double braces for html emails. See the [handlebars documentation](https://handlebarsjs.com/guide/expressions.html#html-escaping) for more information.

You can also delete the welcome email by removing the call to sendTemplatedEmail in src/routes/(admin)/account/api/+page.server.ts

Expand All @@ -38,7 +40,7 @@ Simply add a call to sendAdminEmail() in the appropriate place, passing a subjec

## Adding Additional User Emails

You can add more user emails. Create a template in src/lib/emails, using the welcome email as a guide. You should have both a plaintext and html version of the email (see welcome_email_text.svelte and welcome_email_html.svelte), although it will work with just one.
You can add more user emails. Create a template in src/lib/emails, using the welcome email as a guide. You should have both a plaintext and html version of the email (see welcome_email_text.hbs and welcome_email_html.hbs for examples), although it will work with just one.

When you want to send the email, call sendUserEmail() with the appropriate parameters, including the name of the email template.

Expand Down
Loading

0 comments on commit 0cc7b58

Please sign in to comment.