fix: Update preview_email function to return only HTML

This commit is contained in:
Suraj Shetty 2021-01-13 10:33:06 +05:30
parent 53923264b3
commit e09a0d61d2

View file

@ -1,5 +1,5 @@
frappe.preview_email = function(template, args, header) {
frappe
frappe.preview_email = function(template, args, header, only_html=false) {
return frappe
.call({
method: 'frappe.email.email_body.get_email_html',
args: {
@ -12,6 +12,9 @@ frappe.preview_email = function(template, args, header) {
.then(r => {
var html = r.message;
html = html.replace(/embed=/, 'src=');
if (only_html) {
return html;
}
var d = frappe.msgprint({
message:
'<iframe width="100%" height="600px" style="border: none;"></iframe>',