Blog > Download Email as HTML file

If you've downloaded a Marketo email's HTML using the built-in 'Download HTML' menu option before, it's likely that you got frustrated at the fact that the email still contains Marketo tokens!

Here's a nifty bookmark for your Chrome browser (I've only tested it in chrome), to download the HTML from the preview email UI.

javascript:(function()%7Bif(window.location.hostname.indexOf(%27marketodesigner.com%27)!%3D-1)%7Bvar%20a%3Ddocument.createElement(%27a%27)%2Cb%3Ddocument.getElementsByTagName(%27iframe%27)%5B0%5D.contentDocument.getElementsByTagName(%27html%27)%5B0%5D.outerHTML%2Cd%3Dnew%20Date()%2Cd%3Dd.toISOString().split(%22T%22)%5B0%5D%2B%22_%22%2Bdocument.querySelector(%22title%22).textContent%3Ba.download%3Dd.replace(/%5B%5EA-Za-z0-9%5D/g%2C%27_%27)%2B%22.html%22%3Ba.href%3D%22data%3Atext%2Fplain%2C%22%2BencodeURIComponent(b)%3Ba.click()%3B%7Delse%7Balert(%27Please%20preview%20a%20Marketo%20email%20to%20download%20HTML%27)%7D%7D).call(this)%3B%3Bvoid(0)%3B

Instructions: just add a new bookmark and copy & paste the whole chunk above into the URL then click the bookmark button when previewing a Marketo email (in marketodesigner.com)