为什么我的电子邮件正文没有将提交的数据打印到表格中?
提交时,我尝试将提交数据打印为 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论