33
loading...
This website collects cookies to deliver better user experience
Why can’t I use sendgrid, nodemailer, or any third party library? I could certainly get email notifications to work with just a bit of code snippet and avoid the complete hustle of creating a new cloud service. no?
While you are using azure functions and security is the utmost priority to you. You should avoid integrating a third party library for emails.
{ "type": "object",
"properties": {
"from": { "type": "string" },
"cc": { "type": "string" },
"Attachments": { "type": "array" },
"to": { "type": "string" },
"subject": { "type": "string" },
"html": { "type": "string" },
},
}
const axios = require('axios');
var msg = {
"from": "[email protected]",
"cc": "[email protected];[email protected]",
"Attachments": [{
ContentBytes: blob.data,
Name: "sample-attachment"
}],
"to": "[email protected]",
"subject": "wow!",
"html": "<!DOCTYPE html><html><body><h1>this is soo
coool</h1></body></html>" };
try {
const response = await
axios.post(process.env.LOGIC_APP_URL, msg);
console.log(response.status);
} catch (error) {
console.log(error);
}
}