This example shows how to get
the generated HTML code of email using API.
Click the button and you can see the HTML code of the email
generated from this template in your browser's console.
<!DOCTYPE html>
<html>
<head>
<title>Revolvapp</title>
<meta charset="utf-8">
<!-- css -->
<link rel="stylesheet" href="/your-folder/revolvapp.css" />
</head>
<body>
<!-- button -->
<button onclick="generateHTML()">Generate HTML</button>
<!-- element -->
<div id="myemail"></div>
<!-- js -->
<script src="/your-folder/revolvapp.js"></script>
<!-- call -->
<script>
var app = Revolvapp('#myemail', {
editor: {
path: '/your-path-to-revolvapp-folder/',
template: '/your-path-to-template-file.html'
},
image: {
upload: '/my-backend-upload/'
}
});
// call API method
function generateHTML() {
console.log(app.editor.getHtml());
}
</script>
</body>
</html>