Browse Source

Small fix to the email templates before deploy.

20200319-dbrefactor
Zed A. Shaw 1 week ago
parent
commit
d6f23f8bbc
1 changed files with 14 additions and 6 deletions
  1. +14
    -6
      services/auth.js

+ 14
- 6
services/auth.js View File

@@ -10,24 +10,32 @@ let transporter = nodemailer.createTransport({
streamTransport: true
});

let prod_transporter = nodemailer.createTransport({
secure: false,
ignoreTLS: true,
port: 25,
host: '10.0.2.2',
name: 'learnjsthehardway.com',
});

const gen_reg_email = (to, authtoken) => {
return {
to: to,
from: 'admin@learnjsthehardway.com',
from: '"Zed from LJSTHW" admin@learnjsthehardway.com',
subject: 'Registration request from Learn JS The Hard Way',
text: `You have requested access to https://learnjsthehardway.com/ but we know nothing of the email ${to}. If you want to register, then go to https://learnjsthehardway.com/auth/ and use ${ authtoken } to sign up.`,
html: `<h1>Register for LJSTHW</h1><p>You have requested access to https://learnjsthehardway.com/ but we know nothing of the email ${to}. If you want to register, then go to <a href="https://learnjsthehardway.com/auth/">https://learnjsthehardway.com/auth/</a> and use ${ authtoken } to sign up.<p>`,
text: `Registration for LJSTHW Requested\n\nYou have requested access to https://learnjsthehardway.com/ but we know nothing of the email ${to}. If you want to register, then use ${ authtoken } to sign up`,
html: `<h1>Register for LJSTHW</h1><p>You have requested access to https://learnjsthehardway.com/ but we know │
nothing of the email ${to}. If you want to register, then use ${ authtoken } to sign up.</p>`,
}
}

const gen_login_email = (to, authtoken) => {
return {
to: to,
from: 'admin@learnjsthehardway.com',
from: '"Zed from LJSTHW" admin@learnjsthehardway.com',
subject: 'Authentication request from Learn JS The Hard Way',
text: `Please use the access code ${ authtoken } at https://learnjsthehardway.com/auth/ to access your purchase.`,
html: `<h1>Please use the access code ${ authtoken } at <a href="https://learnjsthehardway.com/auth/">https://learnjsthehardway.com/auth/</a> to access your purchase.</h1>`
text: `Login to LJSTHW Requested\n\nPlease use the access code ${ authtoken } to access the site.`,
html: `<h1>Login to LJSTHW Requested</h1><p>Please use the access code <b>${ authtoken }</b> to access the site.</p>`
}
}


Loading…
Cancel
Save