Skip to content

Instantly share code, notes, and snippets.

@leoaiassistant
Last active November 4, 2020 11:26
Show Gist options
  • Save leoaiassistant/1f1e7bb453bf707b1e618bad5b2c7ba7 to your computer and use it in GitHub Desktop.
Save leoaiassistant/1f1e7bb453bf707b1e618bad5b2c7ba7 to your computer and use it in GitHub Desktop.
function sendEmailHandler (agent) {
const {email, name} = agent.parameters;
const transporter = nodemailer.createTransport({
host: 'smtp.mail.com ',
port: 465,
service: 'gmail',
auth: {
user: 'yourUsername',
pass: 'yourPassword'
}
});
const mailOptions = {
from: "userID", // sender address
to: email, // list of receivers
subject: "Notify2email Demo: Book your AI & Tech Mentoring session 🤖", // Subject line
html: '<h1>Welcome to the Notify2email AI based Assistant 🤖</h1> <h2>We are going to have a great conversation</h2> <p> 🤖 About AI & technology on the mentoring session, your spot is confirmed!✅ </p> ',
attachments:
[{
filename: attachments,
path: attachments,
cid: attachments //my mistake was putting "cid:logo@cid" here!
}]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment