Skip to Content
Azure Serverless Computing Cookbook - Second Edition
book

Azure Serverless Computing Cookbook - Second Edition

by Praveen Kumar Sreeram, Jason Marston
November 2018
Intermediate to advanced
424 pages
10h 55m
English
Packt Publishing
Content preview from Azure Serverless Computing Cookbook - Second Edition

Adding an attachment to the email

Perform the following steps:

  1. Add the following code to the Run method of the SendNotifications function, and save the changes by clicking on the Save button:
message.AddAttachment(FirstName +"_"+LastName+".log",                      System.Convert.ToBase64String                      (System.Text.Encoding.UTF8.GetBytes                      (emailContent)),                       "text/plain",                       "attachment",                       "Logs"                       );
  1. Run a test using the same request payload that we have used in the previous recipes.
  2. This is the screenshot of the email, along with the attachment:
You can learn more about the Send Grid API at https://sendgrid.com/docs/API_Reference/api_v3.html.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Azure Serverless Computing Cookbook

Azure Serverless Computing Cookbook

Praveen Kumar Sreeram
Azure Serverless Computing Cookbook - Third Edition

Azure Serverless Computing Cookbook - Third Edition

Praveen Kumar Sreeram, Kasam Shaikh, Greg Leonardo
Mastering Azure Serverless Computing

Mastering Azure Serverless Computing

Lorenzo Barbieri, Massimo Bonanni

Publisher Resources

ISBN: 9781789615265Supplemental Content