# Alternative subject for group pm email notifications

**URL:** https://meta.discourse.org/t/alternative-subject-for-group-pm-email-notifications/57158
**Category:** Feature
**Created:** [February 9, 2017, 11:48am UTC](https://meta.discourse.org/t/alternative-subject-for-group-pm-email-notifications/57158 "2017-02-09T11:48:35Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![LeoMcA](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/leomca/32/87233_2.png) [@LeoMcA](https://meta.discourse.org/u/LeoMcA)
#### Post date: [February 9, 2017, 11:48am UTC](https://meta.discourse.org/t/alternative-subject-for-group-pm-email-notifications/57158/1 "2017-02-09T11:48:36Z")

</div>

Continuing the discussion from [Email Notification recipients unclear when PM is sent to multiple users](https://meta.discourse.org/t/email-notification-recipients-unclear-when-pm-is-sent-to-multiple-users/26934/24):

> [@Email Notification recipients unclear when PM is sent to multiple users](https://meta.discourse.org/t/email-notification-recipients-unclear-when-pm-is-sent-to-multiple-users/26934/24):
>
> Incidentally, maybe [PM] is not the correct term for the email’s subject. That’s a bit confusing as well.

> [@Email Notification recipients unclear when PM is sent to multiple users](https://meta.discourse.org/t/email-notification-recipients-unclear-when-pm-is-sent-to-multiple-users/26934/24):
>
> I was thinking of group PMs, where the recipient would be a group such as @volunteers.

We’ve just hit this problem, after migrating an email alias to Discourse, and having a few users confused by the subject line reading, for instance: `[PM] Test for Discourse` - it would be prefereable to have that as: `[Reps Leadership] Test for Discourse`. (Where `Reps Leadership` is the full name of the group).

I propose adding an option under the existing custom incoming email address option to `Set %{optional_pm} to group full name` (or clearer words to that effect, if anyone has them).

_pr-welcome_?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [February 9, 2017, 11:50am UTC](https://meta.discourse.org/t/alternative-subject-for-group-pm-email-notifications/57158/2 "2017-02-09T11:50:19Z")

</div>

Sure using the actual group name seems smart.

---

<div class="post-metadata">

### Author: ![alehandrof](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alehandrof/32/119526_2.png) [@alehandrof](https://meta.discourse.org/u/alehandrof)
#### Post date: [February 9, 2017, 12:06pm UTC](https://meta.discourse.org/t/alternative-subject-for-group-pm-email-notifications/57158/3 "2017-02-09T12:06:23Z")

</div>

I think it’s possible to send a PM to multiple users, including multiple groups. What would happen in that case?

---

<div class="post-metadata">

### Author: ![alehandrof](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alehandrof/32/119526_2.png) [@alehandrof](https://meta.discourse.org/u/alehandrof)
#### Post date: [February 9, 2017, 6:43pm UTC](https://meta.discourse.org/t/alternative-subject-for-group-pm-email-notifications/57158/4 "2017-02-09T18:43:19Z")

</div>

Sorry to be the spoil sport.

One idea would be to check: if the message is addressed to only group then go with `[Reps Leadership] Test for Discourse`. Otherwise use `[Group PM] Test for Discourse`. I don’t like the variance, but it’s the only way I could think of salvaging @LeoMcA’s idea.

Another idea is to ditch the usage of “P” entirely and not try and disambiguate by the number of recipients a message has. Just call everything messages:

`[Message] Test for Discourse`

In my [summary of this issue](https://meta.discourse.org/t/email-notification-recipients-unclear-when-pm-is-sent-to-multiple-users/26934/26) this modifies (1). Which means that (2), clarifying recipients in the email, needs to be very clear.

Basecamp gets by with a byline in the footer. I’d start there. Let’s roll it out to our groups and see what catches fire 🙂

---

<div class="post-metadata">

### Author: ![LeoMcA](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/leomca/32/87233_2.png) [@LeoMcA](https://meta.discourse.org/u/LeoMcA)
#### Post date: [February 20, 2017, 8:31am UTC](https://meta.discourse.org/t/alternative-subject-for-group-pm-email-notifications/57158/5 "2017-02-20T08:31:29Z")

</div>

> [@alehandrof](#):
>
> Sorry to be the spoil sport.

np, the only reason I didn’t reply straight away was I’d just started to feel ill with a nasty bout of the flu I’ve just recovered from, and couldn’t wrap my head around any possible solution to the legitimate problem.

> [@alehandrof](#):
>
> Another idea is to ditch the usage of “P” entirely and not try and disambiguate by the number of recipients a message has. Just call everything messages:

We definitely want to be able to distinguish between different types of messages in the subject for our use case.

I wonder if the solution might be to set the subject based on why a user is recieving a notification, so for a notification being sent to `reps-leadership`, `admins` and `@user1`, the subjects are like this:

`reps-leadership`: `[Reps Leadership] Test for Discourse`

`admins`: `[Admin] Test for Discourse`

`@user1`: `[PM] Test for Discourse`

That does still leave the possibility of the problem of a user being in multiple groups, and so sent the notification for multiple reasons (although it would require them to be watching all group inboxes), but I expect this is quite a small edge case, and we can just resort back to using `[PM] Test for Discourse` if it comes up.

With this solution, it would seem to make most sense to have this as a global setting, rather than one on specific groups.

What are the team’s thoughts on this solution?

---

<div class="post-metadata">

### Author: ![alehandrof](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alehandrof/32/119526_2.png) [@alehandrof](https://meta.discourse.org/u/alehandrof)
#### Post date: [February 20, 2017, 8:48am UTC](https://meta.discourse.org/t/alternative-subject-for-group-pm-email-notifications/57158/6 "2017-02-20T08:48:51Z")

</div>

I like the solution. The only possible issue I can think of is that someone might reply to their own message without realising that more people than those identified in the the subject will receive it. A solution would be to identify somehow that there are more recipients in the subject, as well as to mention them in the body of the email. (As I’ve asked for in the other thread.)

---

<div class="post-metadata">

### Author: ![LeoMcA](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/leomca/32/87233_2.png) [@LeoMcA](https://meta.discourse.org/u/LeoMcA)
#### Post date: [February 20, 2017, 9:08am UTC](https://meta.discourse.org/t/alternative-subject-for-group-pm-email-notifications/57158/7 "2017-02-20T09:08:01Z")

</div>

> [@alehandrof](#):
>
> The only possible issue I can think of is that someone might reply to their own message without realising that more people than those identified in the the subject will receive it.

Yes, that’s absolutely a problem. I’ve proposed a solution in the other thread:

> [@Email Notification recipients unclear when PM is sent to multiple users](https://meta.discourse.org/t/email-notification-recipients-unclear-when-pm-is-sent-to-multiple-users/26934/27):
>
> This has been my favourite, “most-email”, solution so far. Does this have to be the case? I see the solution being: if a reply lacks all of the reply keys it was sent out with, a new private message is created, linked to the old one, which doesn’t include any of the users or groups associated with the reply keys which are lacking from the reply.

---

<div class="post-metadata">

### Author: ![LeoMcA](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/leomca/32/87233_2.png) [@LeoMcA](https://meta.discourse.org/u/LeoMcA)
#### Post date: [February 16, 2018, 5:19pm UTC](https://meta.discourse.org/t/alternative-subject-for-group-pm-email-notifications/57158/8 "2018-02-16T17:19:58Z")

</div>

Realized I never posted my PR here:

[https://github.com/discourse/discourse/pull/5475](https://github.com/discourse/discourse/pull/5475)

As the PR says:

> I thought I’d KISS and just use the first group which receives the PM in the subject line. It’s not perfect, and could cause some confusion, but it’s behind a site setting and (I think) is still better than what currently exists.

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [March 7, 2018, 7:03pm UTC](https://meta.discourse.org/t/alternative-subject-for-group-pm-email-notifications/57158/9 "2018-03-07T19:03:39Z")

</div>

Looks like it was never mentioned that this was merged a two weeks ago:  
[https://github.com/discourse/discourse/commit/5d9d0fcb4f3829297e8546b10381b58d3699ca55](https://github.com/discourse/discourse/commit/5d9d0fcb4f3829297e8546b10381b58d3699ca55)

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [March 7, 2018, 7:03pm UTC](https://meta.discourse.org/t/alternative-subject-for-group-pm-email-notifications/57158/10 "2018-03-07T19:03:42Z")

</div>


