For wagtail/wagtail.org#519, when rendering the webpage version of a newsletter, I need to exclude some content (e.g. the unsubscribe link). I'd like to be able to inject an additional flag into the email template, to exclude some blocks when rendering for the web (as opposed to rendering for email delivery). I'd like to be able to do this:
email_html = self.get_newsletter_html(extra_context={"rendering_for_web": True})
For wagtail/wagtail.org#519, when rendering the webpage version of a newsletter, I need to exclude some content (e.g. the unsubscribe link). I'd like to be able to inject an additional flag into the email template, to exclude some blocks when rendering for the web (as opposed to rendering for email delivery). I'd like to be able to do this: