I want to send emails with attachment from an Azure function (Javascript) using SendGrid. I have done the following
- created a new AppSettings for SendGrid API Key
- SendGrid output binding set of Azure Function
Following is my Azure Function
module.exports = function (context, myQueueItem) { var message = { "personalizations": [ { "to": [ { "email": "[email protected]" } ] } ], from: { email: "[email protected]" }, subject: "Azure news", content: [{ type: 'text/plain', value: myQueueItem }] }; context.done(null, {message}); };
Email is getting send correctly. But how do i add an attachment?