Plugin outlets for summary emails

AI-generated summary

The discussion is about adding custom content to Discourse’s summary emails without overwriting the entire template. pfaffman proposes adding stubs in user_notifications.rb to make it possible to insert custom content at specific points in the email, such as after the logo, before “Popular topics”, and before the footer. codinghorror questions the necessity of this solution, suggesting that the template does not change frequently enough to warrant it. pfaffman acknowledges this point but still wonders if their proposed solution would be viable if the problem did exist.

With some frequency people want to add something to the Summary emails (e.g., Need advertising added to the newsletter (Digest), and I just did a project where someone wants some data from custom fields added to summary emails). There is currently no way to do that without overwriting the whole template. This is a huge bummer if and when the template changes.

To my naive way of thinking, it seems like the solution to this problem is that there be some stubs in user_notifications.rb like

  def  digest_text_after_logo (user, opts)
   ""
  end

with corresponding stuff in digest (e.g., @after_logo = digest_text_after_logo) and in the template (e.g., @after_logo after the logo before the following table).

I think the places to add stuff include

  • in the header after the logo
  • before “Popular topics”
  • perhap before “New for you”
  • before the footer/unsubscribe links.

All that to say

  1. Do I understand correctly what would need to be done?
  2. would this be a welcome PR?
  3. Would someone who knows the answer to (1) like to submit the PR?

Seriously? How often does that template change? This seems like a solution in search of a problem.

My guess is that it’ll start changing 3x/week immediately after I count on it not changing. :wink:

https://meta.discourse.org/t/discourse-activity-summary-emails-guide/36627/15?u=pfaffman

But your point is well taken & I’ll proceed as if it’s not likely to change.

I do still wonder if the problem did exist if my solution is on the right track.