Sending automatic replies to private messages for a specific user

Hello,

For a specific user on my Discourse installation, I would like to be able to send automatic replies to any private messages that user receives.

Is there any way to do so?

Thanks in advance,
Thomas

Is it a user who’s account you control? If yes then you could try setting it to mailing list mode and set up a mail autoresponder that would respond to PMs by email.

Thanks for your reply @HAWK.

Yes it is. I tried this though, defining a filter with the destination e-mail address and the words “[PM]” in the e-mail in GMail but GMail never fired the autoresponder.

Is there no way to do this directly in Discourse?

Damn, that’s annoying! @jomaxro might be able to help. He does lots of Gmail–Discourse wrangling.

There is not.

Sadly I cannot help. This is a very similar situation to one I previously attempted to fix via Gmail, but there’s no easy fix. Mail from Discourse has a “mailing list” header, as the email is auto-generated. As one of our engineers explained to me when I asked why:

Because they’re not human-generated. Good mail handling hygiene dictates that you not send autoreplies to machine-generated e-mails, because that is how mail loops form (machine A sends a notification to machine B, machine B sends autoreply to machine A, machine A sends autoreply to machine B, and so on).

To resolve this you’d need to either A) create a Discourse Plugin that can handle this or B) create your own autoresponder service and hook it up to this user. If you choose to do either, be careful to avoid creating a mail loop.

3 Likes

Thanks @jomaxro for taking the time to reply to this.

I understand there’s no real solution for it and if I get some time I might have a try in developing a plugin for it. Maybe it could be a feature request for a future version of Discourse ?

Thomas

Sorry to dig the graves here, but I couldn’t find anything more related to my query.

I’m really interested in this. We run a support forum for a mobile app, and concurrently use an email support service (HelpScout), which is fine but there’s so much repetition in support email that it just has to have a better solution. We went with Discourse as a community counterpart where the support information is shared in one-to-many relationship.

Currently I’m trying to figure out if Discourse could work as a complete support solution for both public and private support queries.
As I’ve read here there have been some experiments with incoming email to Discourse that get treated as group PMs, which is exactly what I’d imagine (coupled with the Assign plugin).

What I’m missing is a way to intercept incoming PMs, run some script on them and possibly respond back with an autogenerated reply, based on analysis of the content, as a “zero level” support. In a similar vein that Zendesk’s Answer Bot works.

I understand that a plugin would need to be built for that, which I’m comfortable with. My question is - where is the pipeline through which the private messages go? Where should I start looking if I want to intercept every PM to a specific group of users?

3 Likes

I would hold tight for a month or 2, @dan is just about to test out very deep IMAP integration support for Discourse where mailboxes are synced and seamless, and it sounds to me like it would be a perfect fit for your use case.

3 Likes

I’m unclear how what you wrote above @sam is an answer to the question stated above?

I guess I was focusing on:

if Discourse could work as a complete support solution for both public and private support queries.

Which IMAP helps with a lot.

Regarding running custom scripts, this is already completely possible without even changing anything in Discourse.

We have Discourse mail receiver per: https://github.com/discourse/mail-receiver it simply talks to a JSON API to deliver mail. One could adapt it to do more pre-processing prior to talking to our API. Or you could create a custom tool here. Plenty of options.

3 Likes

@codinghorror, @sam, big thanks for your replies.
mail-receiver is most probably what I was dreaming about. I’ll take a look at it and try to set it up along my Discourse instance.

Regarding the IMAP integration, is there any public discussion about that? I took a look at udan11’s posting history on meta but did not see any mention of IMAP.

3 Likes

Nothing yet. It is not yet ready for formal testing, let alone production. Dan will post on Meta once we have something ready.

3 Likes

Hi again,

is this PR what you were talking about?

Yes, that’s the PR and it’ll get merged soon.

3 Likes

I’m leaving here a link to a new PR for the IMAP just to better track the status.
https://github.com/discourse/discourse/pull/8301

I’m really looking forward to it, big up to everyone involved!

4 Likes

As it is merged have you already implemented auto reply.
It is something whichcsn be very helpful as most of the emails to PM are known problems which are answered by often used replies