问题描述
我有一个表单字段作为下拉列表(ReasonForMessage),其中包含如下数据:
I have a form field as a drop down (ReasonForMessage) with the data like this:
[email protected];Reason One
[email protected];Reason Two
因此用户可以选择一个原因,然后将通知发送到该原因所附的地址.如果使用电子邮件通知,对于收件人电子邮件,我该如何仅使用宏抓取他们的电子邮件部分.
So user can select a reason, and then the notification would be send to address attached to that reason. If the Email Notification, for the recipient emails, how do i grab just them email portion with a macro.
这是正确的吗?{%ReasonForMessage%}
Is this correct?{% ReasonForMessage %}
我该如何获取数据的第二部分,即实际原因?
And how do i get the second part of the data, the actual Reason?
我基于本文( https://devnet.kentico.com/articles/how-to-send-form-notifications-to-different-emails-based-on-field-values )不确定Kentico 9仍然有效.
I'm basing this on this article (https://devnet.kentico.com/articles/how-to-send-form-notifications-to-different-emails-based-on-field-values) just not sure it's still valid with Kentico 9.
推荐答案
尝试一下.
您可以尝试使用分隔符来存储电子邮件和显示文本,例如下面的冒号...
Try this.
You can try using a delimiter to store both the email and display text, like the colon below...
[email protected]:常规;常规
[email protected]:销售;销售
[email protected]:支持;支持
[email protected]:General;General
[email protected]:Sales;Sales
[email protected]:Support;Support
然后,要获取各个存储的值,请使用Split()分别获取电子邮件和显示文本...
Then, to get the individual stored values use Split() to get the email and display text respectively...
{%category.Split(:")[0]%}
{%category.Split(:")[1]%}
{% category.Split(":")[0] %}
{% category.Split(":")[1] %}
这篇关于Kentico 9表单宏和基于下拉值的其他通知收件人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!