Skip to content

Instantly share code, notes, and snippets.

@patrickfreitasdev
Created September 25, 2022 17:06
Show Gist options
  • Save patrickfreitasdev/2a69b59622f6a2b8f80d911377c65d0d to your computer and use it in GitHub Desktop.
Save patrickfreitasdev/2a69b59622f6a2b8f80d911377c65d0d to your computer and use it in GitHub Desktop.
<?php
// Use [pmu_mail_render] shortcode
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
add_action(
'wp_ajax_forminator_save_builder',
function() {
add_filter(
'wp_kses_allowed_html',
function( $tags, $context ) {
$tags[ 'style' ] = array();
return $tags;
},
10,
2
);
}
);
add_shortcode('wpmu_mail_render', 'wpmu_render_mail_html');
function wpmu_render_mail_html(){
ob_start();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<!--[if gte mso 9]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="x-apple-disable-message-reformatting">
<!--[if !mso]><!--><meta http-equiv="X-UA-Compatible" content="IE=edge"><!--<![endif]-->
<title></title>
<style type="text/css">
/** Your style here **/
</style>
<!--[if !mso]><!--><link href="https://fonts.googleapis.com/css?family=Cabin:400,700&display=swap" rel="stylesheet" type="text/css"><link href="https://fonts.googleapis.com/css?family=Lato:400,700&display=swap" rel="stylesheet" type="text/css"><link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700&display=swap" rel="stylesheet" type="text/css"><link href="https://fonts.googleapis.com/css?family=Raleway:400,700&display=swap" rel="stylesheet" type="text/css"><!--<![endif]-->
</head>
<body>
<!--- Enter any HTML here --->
{all_fields}
</body>
</html>
<?php
$end_result = ob_get_clean();
return $end_result;
}
add_filter( 'forminator_replace_variables', 'do_shortcode' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment