Ability to post newsletter as topic in discourse

Would be amazing if it can one day be possible to forward e-mail newsletters to discourse site to publish as a new topic with correct original formatting.

Currently it seems this is not possible, although there is the feature for a category to mirror a mailing list if subscribed directly. However it can be helpful to be able to review a newsletter mailing first before deciding if this would be good to publish with discourse.

As an example here is a newsletter with event announcement that I have published with copy/paste but it does not have the correct formatting. As a forwarded e-mail the system does not publish the newsletter only publishes if there is new text written in the forwarded message.

Event page:

1 Like

This is what the e-mail looks like:

This would be difficult because the email could contain any kind of content and it’s hard to predict whether or not it would work well in the context of Discourse… an email could even contain malicious executable scripts. By default the type of HTML and CSS allowed in posts is fairly limited to avoid these layout and security issues.

Something like this might be possible with iframes, but this would require the email to be hosted on an external site. You’d also need some control over that external site because embedding the email in an iframe may be prevented by a content security policy (CSP) or X-Frame-Options header. These also exist for security reasons.

To accept any email as HTML post content you’d need some sort of email parsing tool that can determine whether or not the email’s content is safe. I don’t believe this would be a simple task.

3 Likes

That makes sense, for security screening usually disabling remote content from loading unless it is a trusted sender is a good idea.

Subscribed to the governor’s newsletter with general category address will see how those load.

HTML is:

Welcome,

You have successfully created subscriber preferences for Office of the Governor / Office of Financial Management. You are now able to take advantage of the convenient email updates offered by Office of the Governor / Office of Financial Management.

But looks like the Star Destroyer takes down that banner and just posts the text.

Some methods I’ve recommended:

  1. Simplify the newsletter output so it can easily be parsed in Discourse; this is fairly easy to do, but reduces the benefits of using a newsletter system
  2. Use Discourse to create the content, send a newsletter to highlight links to the community site
  3. Create a topic for discussion, and link to the hosted newsletter elsewhere

Most of the time folks are asking for sending and sharing their own newsletter. It sounds like you might want to re-share newsletters sent to you, in which case there is a gotcha: newsletters are almost always customized to included individualized subscription links in the message, and sharing those means others can use them to change the subscription status.

2 Likes

This is an issue, I set a password required for login to that but the “unsubscribe all” link doesn’t require a password login.

Am able to edit that out manually.

This is primarily what I was talking about, don’t have a newsletter to send out myself yet.

For public alert newsletters such as from the department of transportation and local/state + federal government agencies, there are a lot of these.

This is one that has published well just edited out the subscriber links:

Many government websites generate an RSS feed for public announcements; consider using RSS Polling to bring in that content.

1 Like

Thanks didn’t know about that looks like this state does have that:

https://leg.wa.gov/legislature/Pages/AboutLegRSS.aspx

About Washington State Legislature RSS Feeds

The Legislature website currently provides RSS feeds for every bill introduced to the Legislature. Feeds are available for individual bills or you may subscribe to a bill topic feed that has updates for every bill in a certain topic.

Will see if I can set that up with them or the county.

This is a RSS for the county:



Island County, WA - Calendar - Commissioners
Calendar • Island County, WA • CivicEngage
Fri, 12 Jan 2024 11:22:39 -0800
Island County, WA - Get the latest events
en-us

https://www.islandcountywa.gov/RSSFeed.aspx?ModID=58&CID=Commissioners-24

Will research about how to integrate that.

1 Like

RSS works, also e-mail newsletters are mostly posting fully (when category address is subscribed directly to mailing list) unless there is a line break in them then that seems to stop them from loading completely just as with if a message is forwarded.

Here is another topic about this:

1 Like

Dan @Heliosurge had mentioned that there is a plugin to automatically edit out subscription links for newsletter e-mails that are being converted to a discourse topic post, can you post that here and do you know if that can be integrated for standard tier hosted sites or only enterprise / self-hosted?

One issue with the RSS is that if i delete a topic from that which isn’t relevant for my site, it automatically comes back right away. Don’t know if that can be disabled or un-listing a topic instead of deleting it would work instead.

This is a theme-component (not a plugin ) and can be used on any hosted or self hosted instances.

You would need to examine the code and change/modify it to remove the subscribe Links

The author of the component might be willing to make a fork or another coder for some kind of fee. If not able to figure out how to change the code to achieve the desired effect.

Can pehaps accomplish something similar with Wordpress using the email to post plugin and the Discourse WP plugin.

2 Likes