Skip to content

Commit

Permalink
Merge pull request #36 from lowdefy/emailprovider-templates
Browse files Browse the repository at this point in the history
fix(plugin-nodemailer): Fix custom templates in EmailProvider.
  • Loading branch information
SamTolmay authored Dec 7, 2023
2 parents df1ea32 + 8415d0e commit 02af5b7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/four-brooms-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lowdefy/community-plugin-nodemailer': patch
---

Fix custom templates in EmailProvider.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: corepack enable

- name: Install Dependencies
run: pnpm i
run: pnpm i --frozen-lockfile

- name: Test
run: pnpm test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function html({ host, template, templateVariables, theme, url }) {
// Insert invisible space into domains from being turned into a hyperlink by email
// clients like Outlook and Apple mail, as this is confusing because it seems
// like they are supposed to click on it to sign in.
return nunjucksFunction(defaultTemplate ?? template)({
return nunjucksFunction(template ?? defaultTemplate)({
host: host.replace(/\./g, '​.'),
templateVariables,
theme,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { nunjucksFunction } from '@lowdefy/nunjucks';
const defaultTemplate = 'Sign in to {{ templateVariables.appName or host }}';

function subject({ host, template, templateVariables, theme }) {
return nunjucksFunction(defaultTemplate ?? template)({
return nunjucksFunction(template ?? defaultTemplate)({
host,
templateVariables,
theme,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ If you did not request this email you can safely ignore it.
Made with Lowdefy[https://lowdefy.com]`;

function text({ host, template, templateVariables, theme, url }) {
return nunjucksFunction(defaultTemplate ?? template)({
return nunjucksFunction(template ?? defaultTemplate)({
host,
templateVariables,
theme,
Expand Down

0 comments on commit 02af5b7

Please sign in to comment.