-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render email content with MJML #16
Comments
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Create a Django template tag that renders MJML markup into HTML using the approach in #4.
The
NewsletterPageMixin
class should provide two new methods:get_newsletter_html()
: returns the email-friendly HTML representation of the page. It should expect anewsletter_template
attribute on the Page class, that contains the name of a Django template, used to render the HTML; if the attribute has not been set, it should throw a useful exception, with guidance on how to fix it.get_newsletter_context()
: returns the template context for rendering the content. By default it returns{"page": self}
. Can be overridden by subclasses.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:
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.
The text was updated successfully, but these errors were encountered: