INNER CODE UNIT · JavaScript

sendEmail

Cezerin2/Server · src/ajaxRouter.js:191

	async function sendEmail(userId) {
		const countryCode = undefined;
		const [emailTemp] = await Promise.all([
			EmailTemplatesService.getEmailTemplate(
				`forgot_password_${serverSettings.language}`
			)
		]);
		await handlebars.registerHelper('forgot_password_link', obj => {
			const url = `${serverSettings.storeBaseUrl}${
				countryCode !== undefined ? `/${countryCode}/` : '/'
			}reset-password?token=${AuthHeader.encodeUserLoginAuth(userId)}`;
			let text = emailTemp.link;
			if (text == undefined) {
				text = url;
			}
			return new handlebars.SafeString(
				`<a style="position: relative;text-transform: uppercase;border: 1px solid #ccc;color: #000;padding: 5px;text-decoration: none;" value="${text}" href="${url}"> ${text} </a>`
			);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…