Email Basics feature/118-emails #128

Merged
niggl merged 26 commits from feature/118-emails into dev 2021-01-27 16:46:36 +00:00
Showing only changes of commit b92f633d68 - Show all commits

View File

@ -29,14 +29,14 @@ export class Mailer {
public async sendResetMail(to_address: string, token: String) {
const reset_link = `${config.app_url}/reset/${token}`
let body = fs.readFileSync(__dirname + '/static/mail_templates/pw-reset.html', { encoding: 'utf8' });
body = body.replace("{{reset_link}}", reset_link).replace("{{recipient_mail}}", to_address).replace("{{copyright_owner}}", "LfK!").replace("{{link_imprint}}", `${config.app_url}/imprint`).replace("{{link_privacy}}", `${config.app_url}/privacy`);
const body_html = fs.readFileSync(__dirname + '/static/mail_templates/pw-reset.html', { encoding: 'utf8' }).replace("{{reset_link}}", reset_link).replace("{{recipient_mail}}", to_address).replace("{{copyright_owner}}", "LfK!").replace("{{link_imprint}}", `${config.app_url}/imprint`).replace("{{link_privacy}}", `${config.app_url}/privacy`);
const body_txt = fs.readFileSync(__dirname + '/static/mail_templates/pw-reset.html', { encoding: 'utf8' }).replace("{{reset_link}}", reset_link).replace("{{recipient_mail}}", to_address).replace("{{copyright_owner}}", "LfK!").replace("{{link_imprint}}", `${config.app_url}/imprint`).replace("{{link_privacy}}", `${config.app_url}/privacy`);
const mail: MailOptions = {
to: to_address,
subject: "LfK! Password Reset",
html: body
text: body_txt,
html: body_html
};
await this.sendMail(mail);
}