Closed Karyum closed 6 years ago
So i found a great package for this SendGrid
( to be specific @sendgrid/mail
) you could easily make a template on the website and get an API key, and just by doing this
const sg = require('@sendgrid/mail');
sg.setApiKey(process.env.API_KEY);
const msg = {
to: 'mario91sss@gmail.com',
from: process.env.EMAIL,
subject: 'muahha',
templateId: 'ID for the template here',
};
sg
.send(msg)
.then(res => console.log('res'))
.catch(err => console.log('err'));
you could easily send an email, and it also behaves like handlebars ( or mustache syntax ). So for i was also thinking that email should contain following: 1) all the details about the event 2) the username who wants to add it ? 3) a button to verify the event ( which makes a request to the OTP and only admin and superuser can verify )
hmm @des-des i'm thinking the send email thing would happen through the data entry, cause it would be easier to decide ( i think ) which role is the user through the data entry instead of the OTP API.
what do you think ?
ignore this comment :arrow_up:
Search for the best "sending emails" technology to use for sending emails from the API of verifying the data, the way that im thinking of verifying the data currently is to have a link that makes a GET request to the API ( if the token has expired the admin has to log in again)