mirror of https://github.com/xfarrow/blink
e-mail function changed
This commit is contained in:
parent
6d79cb04d9
commit
4564ec84f0
|
@ -18,4 +18,4 @@ POSTGRES_PORT = 5432
|
|||
|
||||
# Application settings
|
||||
ALLOW_USER_REGISTRATION = true
|
||||
NEEDS_EMAIL_VERIFICATION = true # Does this server need users to verify their e-mail address?
|
||||
NEEDS_EMAIL_VERIFICATION = false # Does this server need users to verify their e-mail address?
|
|
@ -9,19 +9,21 @@ let transporter = nodemailer.createTransport({
|
|||
}
|
||||
});
|
||||
|
||||
function sendConfirmationLink(destinationEmail, code) {
|
||||
function sendConfirmationLink(destinationAddress, code) {
|
||||
const confirmationLink = `${process.env.FRONT_END_URL}/activate-account.html?q=${code}`
|
||||
let mailOptions = {
|
||||
from: `"Blink" ${process.env.SMTP_USERNAME}`,
|
||||
to: destinationEmail,
|
||||
subject: 'Verify your Blink Account',
|
||||
// text: 'This is plain HTML',
|
||||
html: getConfirmationLinkHtmlPage(confirmationLink)
|
||||
};
|
||||
sendMail(mailOptions);
|
||||
sendMail(destinationAddress, 'Verify your Blink Account', null, getConfirmationLinkHtmlPage(confirmationLink));
|
||||
}
|
||||
|
||||
function sendMail(mailOptions) {
|
||||
function sendMail(destinationAddress, subject, text, html) {
|
||||
|
||||
let mailOptions = {
|
||||
from: `"Blink" ${process.env.SMTP_USERNAME}`,
|
||||
to: destinationAddress,
|
||||
subject: subject,
|
||||
text: text, // plain text
|
||||
html: html
|
||||
};
|
||||
|
||||
transporter.sendMail(mailOptions, (error, info) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
|
|
Loading…
Reference in New Issue