From 65520b7be0a3bf15be7c9a4deafcd0fa70ea2655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Lima=20Piraj=C3=A1?= Date: Tue, 20 Sep 2022 02:22:05 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20implementa=C3=A7=C3=A3o=20do=20filtro?= =?UTF-8?q?=20para=20consulta=20de=20associados.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mail/mail.js | 54 ++---------------------------------------------- 1 file changed, 2 insertions(+), 52 deletions(-) diff --git a/src/mail/mail.js b/src/mail/mail.js index d82e2db..6dd0c10 100644 --- a/src/mail/mail.js +++ b/src/mail/mail.js @@ -1,27 +1,8 @@ const nodemailer = require('nodemailer'); +const { create } = require('../models/Usuario'); require("dotenv").config(); -async function sendEmailTest({ from, to, subject, text, html }) { - - const testAccount = await nodemailer.createTestAccount(); - const transporter = nodemailer.createTransport({ - host: 'smtp.ethereal.email', - port: 587, - secure: false, - auth: { - user: testAccount.user, - pass: testAccount.pass, - }, - }); - - return transporter.sendMail({ - from, - to, - subject, - text, - html - }); -} +const testAccount = nodemailer.createTestAccount(); const transporter = nodemailer.createTransport({ host: 'smtp.gmail.com', @@ -77,36 +58,5 @@ module.exports = { text: content, }; return transporter.sendMail(emailContent); - }, - async ToVoteNotification({ to, name, quizzTitle }) { - const subject = `Sistema REJUFE: Enquete pendente`; - const text = ` - Prezado(a) ${name}, - - - A sua participação na enquete ${quizzTitle} está sendo solicitada. - Por favor, clique aqui para acessar o sistema. - - - Rede REJUFE`; - const html = ` -

Prezado(a) ${name},

-
-
-

A sua participação na enquete ${quizzTitle} está sendo solicitada. - Por favor, clique aqui para acessar o sistema.

-
-
-

Rede REJUFE

`; - - const emailContent = { - from: process.env.MAIL_USERNAME, - to, - subject, - text, - html - }; - // return transporter.sendMail(emailContent); - return sendEmailTest(emailContent); } } \ No newline at end of file