English 中文(简体)
用消防基地发送电子邮件(使用模板)——在数据领域指定时,能否获得html?
原标题:Sending Email with Firebase (using template) - can you get html rendered when specified in a data field?

当与消防基地发送电子邮件时,。 推广和使用模板,能否在数据领域建立html,是否可提供?

I am trying to send email with Firebase using the extension Firebase provides, and I m using a template. The template has an html body, and I pass in several data parameters.

在两个案例中,我想从数据领域提供html。 不要说两个问题:在某些情况下,没有提出问题(注:数据领域只有html没有提供,模板中的html只是罚款),而在另一些情况下,它完全阻止发出信息。

当我添加标签时,如<条码>邀请Message领域,电子邮件不提供:

“firebase

(note: these screenshots are from two different tests, but you can see that the tags are displayed as raw strings instead of rendering the html.) enter image description here

In a separate field, I am trying to render an entire section of a table (because this entire table cell is dependent on the data passed into the message). But adding this to a data field completely prevents the message from being sent:

<!-- Member Info Content -->
<td style="flex: 0 0 auto; display: flex; align-items: flex-start; flex-direction: column; justify-content: center;"
  class="details-member-info">
  <tr>
    <td><h2 style="font-family:  Inter , sans-serif;">Members</h2></td>
  </tr>
  <tr>
    <td style="text-align: left; padding-left: 48px;">
      <ul style="position: relative; padding-inline-start: 0px;">
        <li style="height: 48px; list-style-type: none; padding: 8px;" class="member-li list-item">
          <img alt="image"
            src="https://firebasestorage.googleapis.com/v0/b/iron-accountability.appspot.com/o/userImages%2FoXC9rWMsUDezvKe0Vu09ON1NMc42%2FprofileImage.jpg?alt=media&amp;token=992e6a97-3755-463b-afab-87b89cc9f7a2"
            style="width: 48px; height: 48px; display: inline-block; vertical-align: middle; object-fit: cover; border-radius: 50%; border: 2px solid #000000;"
            class="member-image" />
          <span style="vertical-align: middle; display: inline-block; padding-left: 8px; font-size: 16px; font-weight: 700; font-family:  Inter , sans-serif;"
            class="member-li-name">Charlie Page</span>
        </li>
        <li style="height: 48px; list-style-type: none; padding: 8px;" class="member-li list-item">
          <img alt="image" src="https://www.lattisapp.com/images/blank-avatar.jpg"
            style="width: 48px; height: 48px; display: inline-block; vertical-align: middle; object-fit: cover; border-radius: 50%; border: 2px solid #000000;"
            class="member-image" />
          <span style="vertical-align: middle; display: inline-block; padding-left: 8px; font-size: 16px; font-weight: 700; font-family:  Inter , sans-serif;"
            class="member-li-name">Charlie Page</span>
        </li>
      </ul>
    </td>
  </tr>
</td>
问题回答

你们可以检查这一点,了解如何将“强硬”转化为“软碎”(Dart)的超文本编码”。

const HtmlEscape htmlEscape = HtmlEscape();
String unescaped =  Text & subject ; // Data you fetched from Firebase store datafields
String escaped = htmlEscape.convert(unescaped);
print(escaped); // Text &amp; subject

unescaped =  10 > 1 and 1 < 10 ; // Data you fetched from Firebase store datafields
escaped = htmlEscape.convert(unescaped);
print(escaped); // 10 &gt; 1 and 1 &lt; 10

unescaped = "Single-quoted:  text "; // Data you fetched from Firebase store datafields
escaped = htmlEscape.convert(unescaped);
print(escaped); // Single-quoted: &#39;text&#39;

unescaped =  Double-quoted: "text" ; // Data you fetched from Firebase store datafields
escaped = htmlEscape.convert(unescaped);
print(escaped); // Double-quoted: &quot;text&quot;

unescaped =  Path: /system/ ; // Data you fetched from Firebase store datafields
escaped = htmlEscape.convert(unescaped);
print(escaped); // Path: &#47;system&#47;

https://api.flutter.dev/flutter/dart-convert/HtmlEscape-class.html





相关问题
Validate value as a float to 3 decimal places

I have users who are pasting strings into text fields that break my calculations. I could really use some help building a regex expression that: only allows numbers 0-9 only allows one "-" ...

Why am I getting No snapshot Data using swift/firebase

I am trying to get my currency from firebase "ballon_dor" to update it when pressing a button. The following code is my getDocument function and currencyLoss function. private static func ...

热门标签