为什么我的电子邮件正文没有将提交的数据打印到表格中?

发布于 2025-01-13 08:50:03 字数 5466 浏览 1 评论 0原文

提交时,我尝试将提交数据打印为 PDF 和电子邮件处理程序的电子邮件正文。我实际上对两者都使用了 twig 代码。提交内容已按照我的要求成功打印在 PDF 字段 中,但未打印在 电子邮件正文。这是我的电子邮件处理程序的完整代码。直到我改变布局后才出现这个问题。谁能告诉我出了什么问题吗?

[webform_submission:token-view-url]
<style>
  th {
      background-color: rgba(143, 220, 242, 0.67);
      border: 1px solid rgba(5, 138, 222, 0.67);
      border-left: 1px solid rgba(5, 138, 222, 0.67);
      border-bottom: 1px solid rgba(5, 138, 222, 0.67);
      color: #000000;
      text-align: center;
      font-weight: bold;
      vertical-align: middle;
      padding: .75em .5em;

  }

  td {
      text-align: right;
      border: 1px solid rgba(5, 138, 222, 0.67);
      vertical-align: middle;
      padding: .75em .5em;
  }

  table {
      border-collapse: collapse;
      border: 1px solid rgba(5, 138, 222, 0.67);
      empty-cells: show;
      margin: 1%;
      width: 100%;
      table-layout: auto;
  }
  #exception {
      background-color: rgba(143, 220, 242, 0.67);
      border: 1px solid rgba(5, 138, 222, 0.67);
      border-left: 1px solid rgba(5, 138, 222, 0.67);
      border-bottom: 1px solid rgba(5, 138, 222, 0.67);
      color: #000000;
      text-align: center;
      font-weight: bold;
  }
</style>

<table>
        <tr>
            <th colspan="2">
                ACCOUNT HOLDER INFORMATION:
            </th>
            <th colspan="2">
                BANK INFORMATION:
            </th>
        </tr>
        <tr>
            <td id="exception">Name</td>
            <td>[webform_submission:values:account_holder_information__01_name]</td>
            <td id="exception">Bank Name</td>
            <td>[webform_submission:values:bank_information__01_bank_name]</td>
        </tr>
        <tr>
            <td id="exception">Address</td>
            <td>[webform_submission:values:account_holder_information__01_address]</td>
            <td id="exception">Branch</td>
            <td>[webform_submission:values:branch]</td>
        </tr>
        <tr>
            <td id="exception">Account #</td>
            <td>[webform_submission:values:account_holder_information__01_account_]</td>
            <td id="exception">Routing #</td>
            <td>[webform_submission:values:routing_number]</td>
        </tr>
        <tr>
            <td id="exception">Email</td>
            <td>[webform_submission:values:account_holder_information__01_email]</td>
            <td style="text-align: center;">[webform_submission:values:notify_by_email_when_transfer_complete]</td>
            <td id="exception">Notify by Email When Transfer Complete</td>
        </tr>
</table>
<br>

<table>
    <tr>
        <th id="exception">REQUEST BY</th>
        <th id="exception">TODAY'S DATE</th>
        <th id="exception" colspan="2">DUE DATE</th>
    </tr>
    <tr>
        <td>[webform_submission:values:requested_by_01_requested_by_02]</td>
        <td>[webform_submission:values:requested_by_01_today_s_date]</td>
        <td colspan="2">[webform_submission:values:requested_by_01_due_date]</td>
    </tr>
    <tr>
        <td id="exception">REQUEST CURRENCY</td>
        <td>[webform_submission:values:currency_rate_01_request_currency]</td>
        <td id="exception">EXCHANGE RATE</td>
        <td>[webform_submission:values:currency_rate_01_exchange_rate]</td>
    </tr>
</table>
<br>

<table>
    <tr>
      <th id="exception">QTY</th>
      <th id="exception">PURPOSE</th>
      <th id="exception">ACCT#</th>
      <th id="exception">DEPT#</th>
      <th id="exception">PROJ#</th>
      <th id="exception">FUNC#</th>
      <th id="exception">TOTAL PRICE</th>
    </tr>

    {% for item in data.spending %}
        <tr>
            <td>{{item.qty}}</td>
            <td>{{item.purpose}}</td>
            <td>{{item.acct_num}}</td>
            <td>{{item.dept_num}}</td>
            <td>{{item.proj_num}}</td>
            <td>{{item.func_num}}</td>
            <td>{{'$ ' ~ item.total}}</td>
        </tr>
    {% endfor %}
    <tr>
        <td id="exception">SUBTOTAL</td>
        <td colspan="6">[webform_submission:values:balance_due_01_balance_due_sub_total]</td>
    </tr>
</table>

<table>
    <tr>
      <th id="exception">AUTHORIZED PURCHASER</th>
      <th id="exception">DIRECTOR APPROVAL</th>
    </tr>
    <tr>
        <td></td>
        <td></td>
    </tr>
    <tr>
      <th id="exception">ACCT APPROVAL</th>
      <th id="exception">EXEC APPROVAL</th>
    </tr>
    <tr>
        <td></td>
        <td></td>
    </tr>
</table>

I am trying to print the submission data to PDF and email body of email handler when I submit. I am literally using the the twig code for both. The submission is successfully printed in PDF field as I wanted, but not in email body. Here is the whole code of my email handler. I didn't have this problem until I changed the layout. Could anyone tell me what is going wrong?

[webform_submission:token-view-url]
<style>
  th {
      background-color: rgba(143, 220, 242, 0.67);
      border: 1px solid rgba(5, 138, 222, 0.67);
      border-left: 1px solid rgba(5, 138, 222, 0.67);
      border-bottom: 1px solid rgba(5, 138, 222, 0.67);
      color: #000000;
      text-align: center;
      font-weight: bold;
      vertical-align: middle;
      padding: .75em .5em;

  }

  td {
      text-align: right;
      border: 1px solid rgba(5, 138, 222, 0.67);
      vertical-align: middle;
      padding: .75em .5em;
  }

  table {
      border-collapse: collapse;
      border: 1px solid rgba(5, 138, 222, 0.67);
      empty-cells: show;
      margin: 1%;
      width: 100%;
      table-layout: auto;
  }
  #exception {
      background-color: rgba(143, 220, 242, 0.67);
      border: 1px solid rgba(5, 138, 222, 0.67);
      border-left: 1px solid rgba(5, 138, 222, 0.67);
      border-bottom: 1px solid rgba(5, 138, 222, 0.67);
      color: #000000;
      text-align: center;
      font-weight: bold;
  }
</style>

<table>
        <tr>
            <th colspan="2">
                ACCOUNT HOLDER INFORMATION:
            </th>
            <th colspan="2">
                BANK INFORMATION:
            </th>
        </tr>
        <tr>
            <td id="exception">Name</td>
            <td>[webform_submission:values:account_holder_information__01_name]</td>
            <td id="exception">Bank Name</td>
            <td>[webform_submission:values:bank_information__01_bank_name]</td>
        </tr>
        <tr>
            <td id="exception">Address</td>
            <td>[webform_submission:values:account_holder_information__01_address]</td>
            <td id="exception">Branch</td>
            <td>[webform_submission:values:branch]</td>
        </tr>
        <tr>
            <td id="exception">Account #</td>
            <td>[webform_submission:values:account_holder_information__01_account_]</td>
            <td id="exception">Routing #</td>
            <td>[webform_submission:values:routing_number]</td>
        </tr>
        <tr>
            <td id="exception">Email</td>
            <td>[webform_submission:values:account_holder_information__01_email]</td>
            <td style="text-align: center;">[webform_submission:values:notify_by_email_when_transfer_complete]</td>
            <td id="exception">Notify by Email When Transfer Complete</td>
        </tr>
</table>
<br>

<table>
    <tr>
        <th id="exception">REQUEST BY</th>
        <th id="exception">TODAY'S DATE</th>
        <th id="exception" colspan="2">DUE DATE</th>
    </tr>
    <tr>
        <td>[webform_submission:values:requested_by_01_requested_by_02]</td>
        <td>[webform_submission:values:requested_by_01_today_s_date]</td>
        <td colspan="2">[webform_submission:values:requested_by_01_due_date]</td>
    </tr>
    <tr>
        <td id="exception">REQUEST CURRENCY</td>
        <td>[webform_submission:values:currency_rate_01_request_currency]</td>
        <td id="exception">EXCHANGE RATE</td>
        <td>[webform_submission:values:currency_rate_01_exchange_rate]</td>
    </tr>
</table>
<br>

<table>
    <tr>
      <th id="exception">QTY</th>
      <th id="exception">PURPOSE</th>
      <th id="exception">ACCT#</th>
      <th id="exception">DEPT#</th>
      <th id="exception">PROJ#</th>
      <th id="exception">FUNC#</th>
      <th id="exception">TOTAL PRICE</th>
    </tr>

    {% for item in data.spending %}
        <tr>
            <td>{{item.qty}}</td>
            <td>{{item.purpose}}</td>
            <td>{{item.acct_num}}</td>
            <td>{{item.dept_num}}</td>
            <td>{{item.proj_num}}</td>
            <td>{{item.func_num}}</td>
            <td>{{'$ ' ~ item.total}}</td>
        </tr>
    {% endfor %}
    <tr>
        <td id="exception">SUBTOTAL</td>
        <td colspan="6">[webform_submission:values:balance_due_01_balance_due_sub_total]</td>
    </tr>
</table>

<table>
    <tr>
      <th id="exception">AUTHORIZED PURCHASER</th>
      <th id="exception">DIRECTOR APPROVAL</th>
    </tr>
    <tr>
        <td></td>
        <td></td>
    </tr>
    <tr>
      <th id="exception">ACCT APPROVAL</th>
      <th id="exception">EXEC APPROVAL</th>
    </tr>
    <tr>
        <td></td>
        <td></td>
    </tr>
</table>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文