wagtail / wagtail-newsletter

Send email newsletters based on Wagtail content
https://wagtail-newsletter.readthedocs.io
BSD 3-Clause "New" or "Revised" License
9 stars 3 forks source link

Render email content with MJML #16

Closed mgax closed 1 month ago

mgax commented 2 months ago

Create a Django template tag that renders MJML markup into HTML using the approach in https://github.com/wagtail/wagtail-newsletter/issues/4.

The NewsletterPageMixin class should provide two new methods:

The result of get_newsletter_html should be displayed in the editor preview, in a new preview mode named Newsletter.


Here is a minimal page that can be rendered as a newsletter:

class NewsletterPage(NewsletterPageMixin, Page):
    newsletter_template = "myapp/newsletter.html"
    body = RichTextField()

If the user chooses to use django-mjml (or even another rendering system than MJML), they should be able to do so, simply by changing the template.