Allow base Email override for standard emails (#5449)

* Make email template overrides work

The ternary needs to be this way for custom email templates to be picked up.

* Allow custom subject lines for emails

Allow subject line to be passed into `inviteUser()` and `requestPasswordReset()`

* Fix typo

* Fix typo

* eslint stuff

* Update users.ts
This commit is contained in:
Sebastian Kinzlinger
2021-05-04 16:31:13 +03:00
committed by GitHub
parent db101e9660
commit faa3ca7a06

View File

@@ -70,8 +70,8 @@ export class MailService {
private async renderTemplate(template: string, variables: Record<string, any>, system = false) {
const resolvedPath = system
? path.join(__dirname, 'templates', template + '.liquid')
: path.resolve(env.EXTENSIONS_PATH, 'templates', template + '.liquid');
? path.resolve(env.EXTENSIONS_PATH, 'templates', template + '.liquid')
: path.join(__dirname, 'templates', template + '.liquid');
const templateString = await fse.readFile(resolvedPath, 'utf8');
const html = await liquidEngine.parseAndRender(templateString, variables);