简体   繁体   English

从天蓝色的表中通过电子邮件发送作业状态

[英]Send job status from a table in azure as email

I have a table in Azure called Job Status which is a small table, row size of 15. I would like to send entire row as email to users from this table. 我在Azure中有一个名为Job Status的表,它是一个小表,行大小为15。我想将整行作为电子邮件从该表发送给用户。

I tried logic app in azure but each email corresponds to one row only. 我在azure中尝试过逻辑应用程序,但每封电子邮件仅对应一行。 I want a single email with all the rows formatted as a table. 我想要一封所有行都格式化为表格的电子邮件。

  1. Create a logic app 创建一个逻辑应用
  2. Add a trigger based on records count or by time 根据记录计数或时间添加触发器
  3. Add an action that calls Azure function for email. 添加一个调用Azure函数以接收电子邮件的操作。 You can use NuGet package Microsoft.Azure.Webjobs.Extensions.SendGrid. 您可以使用NuGet包Microsoft.Azure.Webjobs.Extensions.SendGrid。

I tried logic app in azure but each email corresponds to one row only. 我在azure中尝试过逻辑应用程序,但每封电子邮件仅对应一行。

If you create "Get entities" action and just send email you can find it will create a foreach action, that's because Dynamic content only can get entity one by one. 如果创建“获取实体”操作并仅发送电子邮件,您会发现它会创建一个foreach操作,这是因为动态内容只能逐个获取实体。

在此处输入图片说明

So you could create a csv table after Get Entities like the pic shows. 因此,您可以在如图所示的Get Entities之后创建一个csv表。 在此处输入图片说明

In my situation I got an error: 在我的情况下,我遇到了一个错误:

InvalidTemplate. InvalidTemplate。 The execution of template action 'Create_CSV_table' failed. 模板动作“ Create_CSV_table”的执行失败。 The column values could not be evaluated: 'The template language expression 'item()['additionalProperties']' cannot be evaluated because property 'additionalProperties' doesn't exist, available properties are 'odata.etag, PartitionKey, RowKey, Timestamp, Email, PhoneNumber'. 无法评估列值:无法评估模板语言表达式'item()['additionalProperties']',因为属性'additionalProperties'不存在,可用属性为'odata.etag,PartitionKey,RowKey,Timestamp,电子邮件,电话号码”。 Please see https://aka.ms/logicexpressions for usage details.'. 请参阅https://aka.ms/logicexpressions了解用法详细信息。

If you occur same problem, you could click Code view , the delete the additionalProperties part or you could change the keyword to other properties name you want to show in the mail. 如果您遇到相同的问题,则可以单击“代码视图” ,删除“ additionalProperties部分,或者可以将关键字更改为要在邮件中显示的其他属性名称。 在此处输入图片说明 在此处输入图片说明

After these the mail would like the pic content. 这些之后,邮件将需要图片内容。

在此处输入图片说明

Hope this could help you. 希望这可以对您有所帮助。 If you still have other questions, please let me know. 如果您还有其他问题,请告诉我。

enter image description here 在此处输入图片说明

I could resolve the issue using recurrence,execute a sql query,create html table,and send an email.Recurrence is basically schedule,execute a sql would fetch rows from a table,create html table would do creating excel table in html format,and then send the email 我可以使用重复性解决问题,执行sql查询,创建html表,然后发送电子邮件。重复性基本上是计划,执行sql将从表中获取行,创建html表将以html格式创建excel表,然后然后发送电子邮件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM