Skip to content

Commit

Permalink
done
Browse files Browse the repository at this point in the history
  • Loading branch information
Sambo232 committed May 1, 2022
1 parent 4686179 commit f77f363
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 27 deletions.
4 changes: 0 additions & 4 deletions config.env
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,3 @@ JWT_SECRET=my-ultra-secure-and-ultra-long-secret
JWT_EXPIRES_IN=90d
JWT_COOKIE_EXPIRES_IN=90

EMAIL_USERNAME=a124458539192a
EMAIL_PASSWORD=1e3caf48074eba
EMAIL_HOST=smtp.mailtrap.io
EMAIL_PORT=25
46 changes: 23 additions & 23 deletions utils/email.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
const nodemailer = require('nodemailer');
// const nodemailer = require('nodemailer');

const sendEmail = async options => {
// 1) Create a transporter
const transporter = nodemailer.createTransport({
host: process.env.EMAIL_HOST,
port: process.env.EMAIL_PORT,
auth: {
user: process.env.EMAIL_USERNAME,
pass: process.env.EMAIL_PASSWORD
}
});
// const sendEmail = async options => {
// // 1) Create a transporter
// const transporter = nodemailer.createTransport({
// host: process.env.EMAIL_HOST,
// port: process.env.EMAIL_PORT,
// auth: {
// user: process.env.EMAIL_USERNAME,
// pass: process.env.EMAIL_PASSWORD
// }
// });

// 2) Define the email options
const mailOptions = {
from: 'Jonas Schmedtmann <[email protected]>',
to: options.email,
subject: options.subject,
text: options.message
// html:
};
// // 2) Define the email options
// const mailOptions = {
// from: 'Jonas Schmedtmann <[email protected]>',
// to: options.email,
// subject: options.subject,
// text: options.message
// // html:
// };

// 3) Actually send the email
await transporter.sendMail(mailOptions);
};
// // 3) Actually send the email
// await transporter.sendMail(mailOptions);
// };

module.exports = sendEmail;
// module.exports = sendEmail;

1 comment on commit f77f363

@vercel
Copy link

@vercel vercel bot commented on f77f363 May 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.