-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Authentication with mail notifications (#10)
- Loading branch information
Showing
7 changed files
with
746 additions
and
47 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const nodemailer = require('nodemailer'); | ||
|
||
const transporter = nodemailer.createTransport({ | ||
secure: true, | ||
host: 'smtp.gmail.com', | ||
port: 465, | ||
auth: { | ||
user: '[email protected]', | ||
pass: 'pana spre gxji ozzp' | ||
} | ||
}); | ||
|
||
function sendEmail(email, sub, msg) { | ||
// let to = email; | ||
transporter.sendMail({ | ||
from: '[email protected]', | ||
to: email, | ||
subject: sub, | ||
html:msg | ||
}, (error, info) => { | ||
if (error) { | ||
console.log('Error occurred: ', error); | ||
} else { | ||
console.log('Email Sent: ', info.messageId); | ||
} | ||
}); | ||
} | ||
|
||
|
||
module.exports = sendEmail; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
const mongoose = require('mongoose'); | ||
|
||
const userSchema = new mongoose.Schema({ | ||
|
Oops, something went wrong.