foundersandcoders / open-tourism-platform

An open platform to facilitate the creation of apps to promote local tourism and business in Nazareth
MIT License
17 stars 3 forks source link

Investigate sending emails #178

Closed Karyum closed 6 years ago

Karyum commented 6 years ago

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)

Karyum commented 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 )

Karyum commented 6 years ago

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 ?

Karyum commented 6 years ago

ignore this comment :arrow_up: