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

Add preview text field to demo site #49

Open mgax opened 1 week ago

mgax commented 1 week ago

Refs. https://github.com/wagtail/wagtail-newsletter/issues/41

The text that email clients display is actually the body text of the email. Adding a special preview text, aka a pre-header, actually involves adding a hidden element at the start of the body, that contains the preview text. MJML provides the mj-preview tag for this purpose.

This PR adds a custom field named newsletter_preview to the demo site's ArticlePage model and renders it using MJML in the email body. I think this is something users should add themselves, it's not necessary to add support in the library.