【问题标题】:Sending a HTML Email using Send an Email from Shared Mailbox (V2) on Logic Apps在逻辑应用上使用从共享邮箱 (V2) 发送电子邮件来发送 HTML 电子邮件
【发布时间】:2021-10-20 03:12:17
【问题描述】:

我是 Azure 和逻辑应用程序和堆栈溢出的初学者,我正在尝试使用 Microsoft Azure 上的逻辑应用程序发送自定义电子邮件。

我正在使用以下指南(见下文)将我的模板设置到逻辑应用流中,但我在设置 HTML 变量时遇到了问题。当我将变量设置为 HTML 源代码时,流程无法设置变量并且我没有收到电子邮件。

我使用的 HTML 代码只是我发送给自己的电子邮件中的源代码。

有什么我忽略的吗? 我注意到,对于简单的 html 更改(即只是将句子加粗),流程能够正常工作,并且我能够收到一封电子邮件。

指南:https://blog.sandro-pereira.com/2020/01/26/logic-apps-how-to-send-a-well-formatted-html-email-notification-with-office-365-outlook-connector/

示例 HTML 代码:

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
    {font-family:"Cambria Math";
    panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
    {font-family:Calibri;
    panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
    {margin:0cm;
    font-size:11.0pt;
    font-family:"Calibri",sans-serif;
    mso-fareast-language:EN-US;}
span.EmailStyle17
    {mso-style-type:personal-compose;
    font-family:"Calibri",sans-serif;
    color:windowtext;}
.MsoChpDefault
    {mso-style-type:export-only;
    font-family:"Calibri",sans-serif;
    mso-fareast-language:EN-US;}
@page WordSection1
    {size:612.0pt 792.0pt;
    margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
    {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-AU link="#0563C1" vlink="#954F72" style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal>TestTESt<o:p></o:p></p></div></body></html> ```

【问题讨论】:

    标签: html azure-logic-apps


    【解决方案1】:

    我遵循了相同的说明,并注意到主要问题出在代码中(即,大多数行都被注释了),但是当我尝试使用不同的 HTML 源代码使用相同的方法时,虽然我是能够接收带有我应用的 CSS 样式的电子邮件。

    这是我所说的一个例子。

    html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta  http-equiv="Content-Type"  content="text/html; charset=utf-8"  />
    <title>Internal CSS</title>
    <style>
    body{
    background-color:#9F6;
    }
    
    h1{
    color:#C39;
    text-align:left;
    text-transform:capitalize;
    text-decoration:underline;
    }
    
    P{
    font-size:20px;
    font-family:Verdana, Geneva, sans-serif;
    background-color:#FFF;
    color:#963;
    }
    
    h2{
    color:#F03;
    margin-left:10px;
    }
    
    a{
    margin-left:10px;
    }
    a:hover{ /*---------------This is formate of Pseudo-element---------------*/
    color:#009;
    font-size:18px;
    font-weight:700;
    }
    </style>
    </head>
    
    <body>
    <h1>Example for Internal CSS</h1>
    <p>Cascading Style Sheet is a style language that defines layout of HTML documents.CSS properties such as background, border, font, float, display, margin, opacity, padding, text-align, vertical-align, position, color etc.</p>
    </body>
    </html>
    

    这是我收到邮件的截图

    仅在变量中修改 HTML 代码并重试应该可以解决问题。

    参考:

    https://www.programming9.com/programs/html-codes/291-internal-style-sheet-with-an-example

    【讨论】:

    • 感谢您提供的信息。我意识到我的问题是哈哈
    【解决方案2】:

    我意识到我的问题出在哪里。 我没有意识到变量有字符限制。

    将逻辑应用从无状态工作流更改为有状态工作流解决了该问题。

    更多信息: https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-limits-and-config?tabs=azure-portal

    Character Limit Table For Reference

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-01-03
      • 2020-04-17
      • 1970-01-01
      • 2022-12-13
      • 1970-01-01
      • 1970-01-01
      • 2018-01-25
      • 1970-01-01
      相关资源
      最近更新 更多