# Automation 中的组触发器应包含完整名称的占位符，而非仅简称

**URL:** <https://meta.discourse.org/t/group-triggers-in-automation-should-include-a-placeholder-for-the-full-name-and-not-just-the-stub/306276>\
**Category:** Feature\
**Tags:** automation\
**Created:** [2024年五月1日 04:15 UTC](https://meta.discourse.org/t/group-triggers-in-automation-should-include-a-placeholder-for-the-full-name-and-not-just-the-stub/306276 "2024-05-01T04:15:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jericson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jericson/32/116215_2.png) [@jericson](https://meta.discourse.org/u/jericson)\
**Post date:** [2024年五月1日 04:15 UTC](https://meta.discourse.org/t/group-triggers-in-automation-should-include-a-placeholder-for-the-full-name-and-not-just-the-stub/306276/1 "2024-05-01T04:15:49Z")

</div>

继续讨论 [Discourse 自动化](https://meta.discourse.org/t/discourse-automation/195773/111)：

将某人添加到组或从中移除的触发器包含一个方便的 `group_name` 占位符。不幸的是，它被设置为存根（例如 `support-enthusiasts`），而不是全名（“Discourse Support Enthusiasts”）。[代码](https://github.com/discourse/discourse/blob/d1f008a2fc9a6111280c22779926ec83f03f97e7/plugins/automation/plugin.rb#L140)如下：

```plaintext
            "placeholders" => {
              "group_name" => group.name,
            },

```

由于创建组只需要组名存根，所以我明白为什么代码是这样的。但是，当涉及到在某人加入组时发送欢迎 PM 时，如果可能的话，使用全名会更好：

```plaintext
            "placeholders" => {
              "group_name" => group.full_name || group.name,
            },

```

是否有需要存根的用例？如果是这样，也许可以添加一个新的 `group_full_name` 占位符？

```plaintext
            "placeholders" => {
              "group_name" => group.name,
              "group_full_name" => group.full_name || group.name,
            },

```
