The discussion revolves around editing the email template for watched categories in Discourse. Phuong_SuSu wants to modify the template to include a summary of the topic instead of the full content and change the subject line. HAWK points out that the template is called “User Posted,” but limiting the content to a summary is not currently possible. However, JammyDodger discovers that there is an admin setting called “post excerpts in emails” which can be enabled to include a summary, and the “post excerpt maxlength” setting allows adjusting the length of the excerpt. codinghorror also mentions that @neil has added an optional setting to limit content of posts in email.
When my members choose to watch a category, then another posts new topic, they will receive an email for that.
But here is the current email content:
Subject: Topic title
Content: The whole topic.
I want to edit the template of this email to:
Subject: “A new topic has arrived…”
Content: Just a summary of the topic, around 100 words or the first paragraph.
How can I do this? I couldn’t find that email template in the admin settings area?
You can’t do this yet as the emails are coded by the core with variables that are defined in the core. You will need plugin to override what these variables output in the email template. I am hoping that Discourse develops something similar to Wordpress Filters, so that it will be possible for anyone coding noob to easily override some variables, like these email variables, and customize them without having to write a complicated plugin every time you need to customize some output. Discourse has already implemented something akin to Wordpress Actions with plugin-outlets, but they have yet to implement something like Wordpress Filters, as far as I can tell.