-
Notifications
You must be signed in to change notification settings - Fork 206
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
feat(auth-server): Modify transactional emails to accomodate PayPal payments #7653
Changes from 1 commit
fe38349
4f12f62
85088e0
d6ad532
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,8 @@ async function init(log) { | |
handlebars.txt.registerHelper('t', translate); | ||
handlebars.html.registerHelper('or', orHelper); | ||
handlebars.txt.registerHelper('or', orHelper); | ||
handlebars.html.registerHelper('ifEquals', isEqualHelper); | ||
handlebars.txt.registerHelper('ifEquals', isEqualHelper); | ||
|
||
// helpers from https://gist.github.com/servel333/21e1eedbd70db5a7cfff327526c72bc5 | ||
const reduceOp = function (args, reducer) { | ||
|
@@ -47,6 +49,13 @@ async function init(log) { | |
return reduceOp(arguments, (a, b) => a || b); | ||
} | ||
|
||
function isEqualHelper(a, b, options) { | ||
if (a === b) { | ||
return options.fn(this); | ||
} | ||
return options.inverse(this); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consistency suggestion: using the pattern from
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤦 Sorry about that. In that case, please delete that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok so - I was mistaken! This helper is actually used here. I had been looking for |
||
|
||
await forEachTemplate(PARTIALS_DIR, (template, name, type) => { | ||
handlebars[type].registerPartial(name, template); | ||
}); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<br> | ||
{{#ifEquals payment_provider "paypal"}} | ||
{{t "PayPal" }} | ||
{{/ifEquals}} | ||
|
||
{{#ifEquals payment_provider "stripe"}} | ||
{{#if lastFour}} | ||
{{t "%(cardType)s card ending in %(lastFour)s" }} | ||
{{/if}} | ||
{{/ifEquals}} | ||
lesleyjanenorton marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{{#ifEquals payment_provider "paypal"}} | ||
{{t "PayPal" }} | ||
{{/ifEquals}} | ||
|
||
{{#ifEquals payment_provider "stripe"}} | ||
{{#if lastFour}} | ||
{{t "%(cardType)s card ending in %(lastFour)s" }} | ||
{{/if}} | ||
{{/ifEquals}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this function doesn't really need to be in a class.