1.8.6. 标记 'email' (向上)
电子邮件 标签允许您自定义传出电子邮件的标头,且仅在电子邮件模板中可用。
有几个方便的子标签,如 cc 或 subject (请参见下表),但您也可以使用 标题 子标签为邮件设置任意 SMTP 标头。
| 子标签 | 描述 | 示例 |
| 主题 | 动态主题 | {% 主题 = 'Greetings from Example company!' %} |
| cc | 碳复制 | {% cc = 'boss@example.com' %} |
| bcc | 它们的碳排放 | {% bcc = 'all@example.com' %} |
| 来自 | 实际发送者 | {% from = 'system@example.com' %} |
| 回复 | {% 回复 = 'support@example.com' %} | |
| 标头 | 自定义 SMTP 标头 | {% 标头 'X-SMTP-Group' = 'Important' %} |
| do_not_send | 丢弃电子邮件 | {% do_not_send %} |
示例: 条件玻璃碳体复制
{% email %}
{% if plan.system_name == 'enterprise' %}
{% bcc 'marketing@world-domination.org' %}
{% endif%}
{% endemail %}示例: 完全禁用电子邮件
{% email %}
{% do_not_send %}
{% endemail %}示例: 注册电子邮件过滤器
{% email %}
{% if plan.system == 'enterprise' %}
{% subject = 'Greetings from Example company!' %}
{% reply-to = 'support@example.com' %}
{% else %}
{% do_not_send %}
{% endif %}
{% endemail %}