官术网_书友最值得收藏!

How to do it...

  1. Navigate to the Integrate tab of the RegisterUser function, click on New Output , and choose Azure Blob Storage.
  2. Provide the required parameters in the Azure Blob Storage output (outputBlob) section, as shown in the following screenshot. Note the .log extension in the Path field:
  1. Navigate to the code editor of the run.csx file and make the following change:
    1. Add a new parameter outputBlob of type TextWriter to the Run method.
    2. Add a new string variable named emailContent. This variable is used to frame the content of the email. We will also use the same variable to create the log file content that is finally stored in the blob.
    3. Frame the email content by appending the required static text and the input parameters received in Request body:
                public static void Run(HttpRequestMessage req, 
TraceWriter log,
CloudTable objUserProfileTable,
out string objUserProfileQueueItem,
out Mail message,
TextWriter outputBlob
)
....
....
string email = inputJson.email;
string profilePicUrl = inputJson.ProfilePicUrl;
string emailContent ;
....
....
emailContent = "Thank you <b>" + firstname + " " +
lastname +"</b> for your registration.<br><br>" +
"Below are the details that you have provided us<br>
<br>"+
"<b>First name:</b> " + firstname + "<br>" +
"<b>Last name:</b> " + lastname + "<br>" +
"<b>Email Address:</b> " + email + "<br>" +
"<b>Profile Url:</b> " + profilePicUrl + "<br><br>
<br>" +
"Best Regards," + "<br>" + "Website Team";
message.AddContent(new
Content("text/html",emailContent));
....
....
outputBlob.WriteLine(emailContent);
  1. Run a test using the same request payload that we have used in the previous recipe.
  2. After running the test, the log file got created in the container named userregistrationemaillog:
主站蜘蛛池模板: 略阳县| 防城港市| 喜德县| 孟村| 姜堰市| 宜都市| 江口县| 南木林县| 陇南市| 和硕县| 乌拉特后旗| 宜君县| 九寨沟县| 兴海县| 墨玉县| 女性| 三河市| 喀喇沁旗| 彩票| 安化县| 新野县| 涡阳县| 迁西县| 三穗县| 无极县| 民勤县| 叶城县| 久治县| 丹巴县| 乐安县| 新绛县| 巴南区| 宁河县| 竹山县| 吉木萨尔县| 炎陵县| 凉城县| 宜春市| 板桥市| 惠水县| 叙永县|