0

I'm building a user dashboard in Django for a python based web service. This web service creates emails, and the HTML strings of these emails are saved in a file (and could theoretically also be saved in a db table). As part of the dashboard functionality I want to be able to preview the email, essentially rendering the html string of the email within the Django html view. Is it possible to do this? Will I need to work with a Javascript library to achieve this? Which one? Any help would be very appreciated!

EDIT

To clarify, the html string when put into a text editor is about 360+ lines. It has its own styling and it's own <head>, <body>, etcetera, tags. I want to display it like a webpage within a webpage, if that makes sense, so that it looks like a proper preview. I just have no idea how to do this, my experience hasn't really been with js or front end dev.

1
  • You can render it. What's exactly the problem? Commented Jun 13, 2013 at 14:27

2 Answers 2

2

make the email html available like any other page and display it inside of an iframe.

be warned - email clients don't use the same rendering engines as browsers. its hell. (we use this - https://litmus.com)

Sign up to request clarification or add additional context in comments.

Comments

0

Nothing more but:

document.getElementById('IDofDisplayContainer').innerHTML = 'your mail HTML string';

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.