0

I want to create a function app to dynamically get Blob contents which are getting stored in a container in my storage account. The function app should be able to send the blob contents as an attachment via mail.

Any idea if this is possible?

Thanks!

SD4
  • 439
  • 10
  • 27
  • Are you using SendGrid? I think you'll need to have the Function download the blob to its local file system, then you should be able to add it as an attachment: https://stackoverflow.com/questions/37945281/sending-an-email-with-attachment-using-sendgrid – Joel Cochran Oct 21 '20 at 14:48
  • Why don't you use Logic App? – Harshita Singh Oct 21 '20 at 19:40
  • What is your requirement? Do you mean get the blob when it is changed? For sending the email, the only way in azure function is to use sendgrid. – Cindy Pau Oct 22 '20 at 00:43

1 Answers1

1

Yes, you can. But the only way to send the email is to use sendgrid(this is by designed.):

https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-sendgrid?tabs=javascript#example

For getting the blob, you can use blob input binding or just put the logic in the body of the function.

And offcial document below is the simple code to use sendgrid to send attachment:

https://github.com/sendgrid/sendgrid-nodejs/blob/main/docs/use-cases/attachments.md

Cindy Pau
  • 13,085
  • 1
  • 15
  • 27