mirror of
				https://github.com/xfarrow/blink
				synced 2025-06-27 09:03:02 +02:00 
			
		
		
		
	e-mail function changed
This commit is contained in:
		| @@ -18,4 +18,4 @@ POSTGRES_PORT = 5432 | |||||||
|  |  | ||||||
| # Application settings | # Application settings | ||||||
| ALLOW_USER_REGISTRATION = true | 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}` |     const confirmationLink = `${process.env.FRONT_END_URL}/activate-account.html?q=${code}` | ||||||
|     let mailOptions = { |     sendMail(destinationAddress, 'Verify your Blink Account', null, getConfirmationLinkHtmlPage(confirmationLink)); | ||||||
|         from: `"Blink" ${process.env.SMTP_USERNAME}`, |  | ||||||
|         to: destinationEmail, |  | ||||||
|         subject: 'Verify your Blink Account', |  | ||||||
|         // text: 'This is plain HTML', |  | ||||||
|         html: getConfirmationLinkHtmlPage(confirmationLink) |  | ||||||
|     }; |  | ||||||
|     sendMail(mailOptions); |  | ||||||
| } | } | ||||||
|  |  | ||||||
| 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) => { |     transporter.sendMail(mailOptions, (error, info) => { | ||||||
|         if (error) { |         if (error) { | ||||||
|             console.error(error); |             console.error(error); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user