Restore Mailing List Mode Daily Summary

Preface:

This is not really an update to the Plugin but rather a hotfix. It does not really patch the plugin to work with the new system but rather integrates parts that were removed into the Plugin. It is not future proof. And it certainly won’t fix that the discourse team has deamed daily summarys an unessesairy edge case rather than an important part to keep users who prefer E-Mail in the loop. Discourse can not really be used as a Mailing list replacement anymore and if you can move you should. It also won’t fix the “we don’t need a documentation or propper release notes” thing< /rant>

That being said. We use this in Production and it seems to work. It’s not good but whatever

How to Get mails flowing again

  1. Iplement @lkramer s fix
    Restore Mailing List Mode Daily Summary - #52 by lkramer

now you can actually toggle the UI Button again

  1. Readd the method apply_notification_styles
    in engine.rp add the Following at line 11 (first method in the class)
 def apply_notification_styles(email)
                   email.html_part.body = Email::Styles.new(email.html_part.body.to_s).tap do |styles|
                   styles.format_basic
                   styles.format_html
                   end.to_html
                   email

Note that the originalt function (See the commit that broke everything to read along) used styles.format_notification instead of styles.format_html since _notification was removed we are simply using _html. Is this a good idea? No. Does it work? Seems so. Hey at least we have a slight chance it won’t get removed with the next update

  1. Snake oil

I also wrhapped the whole mailing_list.html.erb in a Div tag with the class summary-email and disabled theming for summary E-Mails in the settings. This was just a desprate try at first and did not yield any results. You will most likely be fine without it but I won’t touch this mess again unless it breaks again. So if you face formating problems reel free to try this

Hope this helps

1 Like