# 在邮件通知（HTML 版本）中包含投票选项

**URL:** https://meta.discourse.org/t/include-poll-options-in-email-notification-html-variant/393728
**Category:** UX
**Tags:** email, polls
**Created:** [2026年一月17日 16:41 UTC](https://meta.discourse.org/t/include-poll-options-in-email-notification-html-variant/393728 "2026-01-17T16:41:49Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![JJde](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@JJde](https://meta.discourse.org/u/JJde)
#### Post date: [2026年一月17日 16:41 UTC](https://meta.discourse.org/t/include-poll-options-in-email-notification-html-variant/393728/1 "2026-01-17T16:41:49Z")

</div>

您好，尊敬的 Discourse 开发者们！

当前行为：当我收到关于包含投票的新帖子的电子邮件通知时，该电子邮件的纯文本版本包含了投票的源代码（`[polll type=...] * Yes * No * Other [/poll]`）。  
然而，该电子邮件的 HTML 版本只包含一个链接“点击此处查看投票”。

我建议在电子邮件的 HTML 版本中也列出可用的选项。

在我看来，这极大地改善了用户体验。在移动设备上查看电子邮件通知时，直接查看投票比必须打开链接要简单得多。  
除了这个用户体验（UX）的论点之外，电子邮件的 HTML 和纯文本版本包含不同数量的信息也显得不妥。

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [2026年二月13日 13:49 UTC](https://meta.discourse.org/t/include-poll-options-in-email-notification-html-variant/393728/3 "2026-02-13T13:49:17Z")

</div>

早就该这样做了。感谢 @JJde 的提醒 👍

> <https://github.com/discourse/discourse/pull/37812>
>
> Previously, the HTML variant of email notifications replaced the entire poll wit…h a "Click to view the poll" link, while the plain-text variant included all the poll options. This meant the HTML email contained less information than its plain-text counterpart.
> 
> Now the \`reduce\_cooked\` callback preserves the poll title and options list, strips the interactive parts (vote counts, buttons) and \`data-poll-option-id\` attributes, and still appends the link to vote.
> 
> This works for all poll types (regular, multiple, number, ranked\_choice) since they all share the same \`.poll-container \> ul/ol \> li\` structure.
> 
> https://meta.discourse.org/t/393728

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [2026年二月23日 07:00 UTC](https://meta.discourse.org/t/include-poll-options-in-email-notification-html-variant/393728/5 "2026-02-23T07:00:27Z")

</div>

此主题在 2 天后自动关闭。不再允许回复。
