-
Notifications
You must be signed in to change notification settings - Fork 3
Sending of emails
Ringo Ng edited this page Mar 22, 2017
·
1 revision
Example use
import sendEmail from '/js/email/email'
//in a react component
sendEmail(data);
The data object passed to sendEmail must contain these properties
data = {
receiver,
sender,
subject,
receiverFName,
senderFName,
description,
authToken,
emailAPiService
}
-
Receiver is the recipient of the email.
-
Sender is what it displays as the sender of the email.
-
Subject is the subject of the email.
-
receiverFName is the name that will be addressed in the email.
-
senderFName is the name that will sign the email.
-
description is the description of the potluck.
-
authToken is the api key SendGrid will check.
-
emailAPiService is the link to the api which will send the email for us.
Example Data
const data = {
receiver: '[email protected]',
sender: '[email protected]',
subject: 'New Potluck Invite!!!!!!!!!!!!!',
receiverFName: 'Timmy',
senderFName: 'Jimmy',
description: 'This is an example description for a example potluck email.'
authToken: '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', // This api directs to the free account Ringo made.
emailAPiService: 'https://api.sendgrid.com/v3/mail/send', // this will stay the same as long as we use sendgrid
};