配置传入邮件以创建新主题或组消息

:bookmark: 本指南介绍如何设置接收邮件以在 Discourse 中创建新主题或群组消息,包括站点设置以及特定类别或群组的配置。

:person_raising_hand: 所需用户等级:管理员

本指南涵盖以下内容:

  • 启用和配置接收邮件
  • 选择为接收邮件使用类别还是群组
  • 为群组设置接收邮件
  • 为类别设置接收邮件
  • 决定如何处理转发邮件

:information_source: 如果您已经设置过通过邮件回复,或者您使用的是已预先配置接收邮件的托管计划,那么您现在可以开始设置“通过邮件创建新主题”了。

配置站点设置

要启用接收邮件,您需要配置三个主要的站点设置:

  1. email_in:必须启用此设置才能使接收邮件功能正常工作。
  2. email_in_allowed_groups:用户必须属于此列表中的某个群组,才能向 Discourse 发送邮件。默认包括管理员、版主和信任等级为 2 的用户。
  3. enable_staged_users:此设置允许为未知的电子邮件地址创建临时用户(staged users)。

:warning: 对于 Discourse 托管站点,enable_staged_users 设置在试用期间会被禁用并隐藏,以防止滥用。一旦开始订阅,该设置将不再隐藏。如果您希望在试用期间启用该设置,请联系 team@discourse.org

配置这些设置的步骤如下:

  1. 进入您站点的管理面板
  2. 导航至“设置”
  3. 搜索每个设置并按需进行配置

:information_source: 临时用户(staged users)是 Discourse 中为支持任何人发送接收邮件而创建的特殊用户账户。它们的功能有限:

  • 无法被提及或搜索
  • 不会收到摘要邮件
  • 只能收到并回复他们发起或受邀参与的主题
  • 如果使用相同的电子邮件地址创建账户,将被提升为普通用户

在类别和群组之间进行选择

请决定您希望接收邮件是在类别中创建主题,还是在群组中创建消息。

使用群组

使用群组的优势:

  • 适用于设置类似客服的工作流程
  • 会向所有群组成员发送消息
  • 消息会显示在 /my/messages
  • 任何人都可以向群组发送邮件
  • 任何群组成员都可以阅读、回复、删除或归档消息
  • 每个群组成员都有独立的已读跟踪状态

使用类别

使用类别的优势:

  • 模拟邮件列表
  • 在指定类别中创建主题
  • 任何有权访问该类别的人都可以通过网页界面或邮件阅读和回复
  • 遵守类别安全设置
  • 遵守 email_in_allowed_groups 站点设置
  • 允许按类别单独禁用临时用户

为群组设置接收邮件

配置群组接收邮件的步骤:

  1. 从主菜单进入“群组”页面

  2. 点击群组名称(或创建一个新群组)

  3. 对于新群组,在表单底部找到“自定义接收电子邮件地址”字段

  4. 对于现有群组,进入“管理”选项卡,然后在左侧菜单中点击“交互”

  5. 输入您希望与群组关联的电子邮件地址(多个地址请用 | 分隔)

  6. 点击“保存”以应用更改

:warning: 对于 Discourse 托管站点,请参阅下方的额外说明,在此处

为类别设置接收邮件

配置类别接收邮件的步骤:

  1. 进入类别页面(例如 /c/<category_slug>

  2. 点击 :wrench: 扳手按钮以编辑类别
    Edit category button

  3. 在“编辑类别”页面,点击“设置”选项卡

  4. 查找“接受来自无账户匿名用户的邮件”和“自定义接收电子邮件地址”字段

  5. 如果您希望为未知电子邮件地址创建临时用户,请启用“接受来自无账户匿名用户的邮件”

  6. 输入您希望与类别关联的电子邮件地址

  7. 点击“保存类别”以应用更改

:warning: 对于 Discourse 托管站点,请参阅下方的额外说明,在此处

转发邮件的行为

您可以通过 forwarded_emails_behaviour 站点设置决定转发邮件在 Discourse 中的显示方式,该设置提供以下选项:

  • hide(隐藏):创建新主题或私信,将转发文本作为隐藏文本包含在内,可展开查看
  • quote(引用):创建新主题或私信,将转发文本作为引用文本包含在内
  • create replies(创建回复):创建新主题或私信,由原始发件人作为作者。回复将由邮件中的参与者作为作者创建。如果系统中尚不存在与发件人邮箱地址匹配的用户账户,将为其创建临时用户账户

Discourse 托管站点的特殊说明

Discourse 客户必须使用以下格式作为您的接收电子邮件地址:

  • {ANYTHING}@{YOUR PREFIX}.discoursemail.com
  • {YOUR PREFIX}+{ANYTHING}@discoursemail.com
  • {ANYTHING}@{YOUR.SITE.DOMAINNAME}

其中:

  • ANYTHING 可以替换为标准电子邮件地址中允许的任何字符组合
  • YOUR PREFIX 对应「接受发送至以下地址的邮件」设置中建议的 + 号前的首组字符
    查看截图

  • YOUR.SITE.DOMAINNAME 对应用户访问您站点时使用的域名(不含 https:// 协议)
  • 所有花括号均需移除

此外,如果您是托管客户并希望使用完全独特的电子邮件地址(不符合上述格式),您可以通过第三方电子邮件服务提供商设置该地址,并将所有收到该地址的邮件转发到您的站点。您必须启用「接受发送至以下地址的邮件」选项,并使用该选项下方显示的电子邮件地址作为转发地址。

其他资源

50 个赞
Understanding email in functionality
Troubleshoot reply by email
Good use cases for groups (to better understand groups vs categories)
Post without signup?
Setting an incoming e-mail address for the staff group
When site require approvals for users, email replies do not get sent to staged users
How to configure group email address
Receiving emails into Discourse messages. Can this be done?
Use Discourse as a Private Support/Ticket System
Configuring alternative incoming email address for hosted account
Start Discourse by Mail
Using discourse to manage support emails: receive and reply
How do I set up group email addresses?
Creating a staged user with an API call
Good guide on how to use discourse via email
Start Topic via E-Mail with different domain
Utilising email support for reporting from grafana
Category configuration option : mirrors a mailing list
Discourse will not accept forwarded email but successfully sends and an error message to the original sender?
Changing email subject line should start a new topic
Can Discourse accept attachments when using emails to create new category topics?
Implementing KCS
Use aliases in iRedMail for categories with incoming email feature enabled
What is the "Custom incoming email address"?
Preferred communication channel for accessibility for blind readers?
Trying to setup direct delivery of incoming email and new topic by email
Can I start a new topic by sending an email message?
Canonical doc on using discourse via email for end-users?
"Email in allowed groups" setting is too permissive
Error adding a backup email address: address already in use by a staged user
Find the reply key for a specific topic. Rails console magic?
Allowing email from a stranger because I trust them. How?
Can’t set email-in for existing group?
Query about creating topics in a category using email
Use Discourse as a Private Support/Ticket System
What exact email address do I use for “Custom Incoming email address”?
Contact Form
How to configure Discourse to receive email from Mailgun?
Can an admin create a staged user?
Simple sensor-driven notifications in Discourse via Webhooks or MQTT?
Configuring Incoming Email to Create Category Topics or Group Messages
Configuring Incoming Email to Create Category Topics or Group Messages
Setting up a support inbox
Category configuration option : mirrors a mailing list
[PAID] Auto create new topic when I publish a video on YouTube
Who is Discobot?
Configuring incoming email to create new topics with email forwarding?
Anonymous form that creates a topic
How to go about hosting a design contest?
Can I start a new topic by sending an email message?
Can I start a new topic by sending an email message?
Can’t set email-in for existing group?
Can’t set email-in for existing group?
Discourse 1.9.0.beta15 Release Notes
Registering unregistered users on first email a la mailman?
Private support categories: staged users can email in, but not registered users
Creating a topic via email without write access to the category?
What is a staged user?
New group PM from email
How to create topics from a custom email address?