PluginProbe
YayMail – WooCommerce Email Customizer / 3.3.1
YayMail – WooCommerce Email Customizer v3.3.1
4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 trunk 1.9.6 2.1.4 2.1.5 3.2.2 3.2.6 3.2.7.1 3.2.8.1 3.2.9 3.3 3.3.1 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4 3.4.1 All 57 releases
yaymail / views / templates / pip-mail-template.php

pip-mail-template.php in YayMail – WooCommerce Email Customizer 3.3.1, at views/templates/pip-mail-template.php

123 lines 7.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit;
4 }
5
6 use YayMail\Page\Source\UpdateElement;
7 $custom_shortcode = new YayMail\MailBuilder\Shortcodes( $template, '', false );
8 $arrData = array( $custom_shortcode, $args, $template );
9 do_action_ref_array( 'yaymail_addon_defined_shorcode', array( &$arrData ) );
10
11 $updateElement = new UpdateElement();
12 $yaymail_elements = get_post_meta( $postID, '_yaymail_elements', true );
13 $yaymail_elements = $updateElement->merge_new_props_to_elements( $yaymail_elements );
14 $yaymail_template = get_post_meta( $postID, '_yaymail_template', true );
15 $yaymail_settings = get_option( 'yaymail_settings' );
16 $emailBackgroundColor = get_post_meta( $postID, '_email_backgroundColor_settings', true ) ? get_post_meta( $postID, '_email_backgroundColor_settings', true ) : '#ECECEC';
17 $general_attrs = array( 'tableWidth' => str_replace( 'px', '', $yaymail_settings['container_width'] ) );
18 ?>
19 <!DOCTYPE html>
20 <html lang="en">
21 <head>
22 <meta charset="UTF-8">
23 <meta http-equiv="X-UA-Compatible" content="IE=edge">
24 <meta name="viewport" content="width=device-width, initial-scale=1"/>
25 <style>
26 h1{ font-family:inherit;text-shadow:unset;text-align:inherit;}
27 h2,h3{ font-family:inherit;color:inherit;text-align:inherit;}
28 </style>
29 </head>
30 <body style="background: <?php echo esc_attr( $emailBackgroundColor ); ?>">
31 <table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" class="<?php echo esc_attr( 'yaymail-template-' . $yaymail_template ); ?>">
32 <?php
33 foreach ( $yaymail_elements as $key => $element ) {
34 ?>
35 <tr><td>
36 <?php
37 $reg_pattern = '/\[([a-z0-9A-Z_]+)\]/';
38 if ( isset( $element['settingRow']['content'] ) ) {
39 $content = $element['settingRow']['content'];
40 $contentTitle = isset( $element['settingRow']['contentTitle'] ) ? $element['settingRow']['contentTitle'] : '';
41
42 // Add $atts for content if has shortcode
43 preg_match_all( $reg_pattern, $content, $result );
44 if ( ! empty( $result[0] ) ) {
45 foreach ( $result[0] as $key => $shortcode ) {
46 $textcolor = isset( $element['settingRow']['textColor'] ) ? ' textcolor=' . $element['settingRow']['textColor'] : '';
47 $bordercolor = isset( $element['settingRow']['borderColor'] ) ? ' bordercolor=' . $element['settingRow']['borderColor'] : '';
48 $titlecolor = isset( $element['settingRow']['titleColor'] ) ? ' titlecolor=' . $element['settingRow']['titleColor'] : '';
49 $fontfamily = isset( $element['settingRow']['family'] ) ? ' fontfamily=' . str_replace( ' ', '', str_replace( array( '\'', '"' ), '', $element['settingRow']['family'] ) ) : '';
50 $newshortcode = substr( $shortcode, 0, -1 );
51 $newshortcode .= $textcolor . $bordercolor . $titlecolor . $fontfamily . ']';
52 $content = str_replace( $shortcode, $newshortcode, $content );
53 }
54 $element['settingRow']['content'] = $content;
55 }
56 // Add $atts for contentTitle if has shortcode
57 if ( $contentTitle ) {
58 preg_match_all( $reg_pattern, $contentTitle, $result );
59 if ( ! empty( $result[0] ) ) {
60 foreach ( $result[0] as $key => $shortcode ) {
61 $textcolor = isset( $element['settingRow']['textColor'] ) ? ' textcolor=' . $element['settingRow']['textColor'] : '';
62 $bordercolor = isset( $element['settingRow']['borderColor'] ) ? ' bordercolor=' . $element['settingRow']['borderColor'] : '';
63 $titlecolor = isset( $element['settingRow']['titleColor'] ) ? ' titlecolor=' . $element['settingRow']['titleColor'] : '';
64 $fontfamily = isset( $element['settingRow']['family'] ) ? ' fontfamily=' . str_replace( ' ', '', str_replace( array( '\'', '"' ), '', $element['settingRow']['family'] ) ) : '';
65 $newshortcode = substr( $shortcode, 0, -1 );
66 $newshortcode .= $textcolor . $bordercolor . $titlecolor . $fontfamily . ']';
67 $contentTitle = str_replace( $shortcode, $newshortcode, $contentTitle );
68 }
69 $element['settingRow']['contentTitle'] = $contentTitle;
70 }
71 }
72
73 // Add $atts for content of shipment tracking if has shortcode
74 if ( '[yaymail_order_meta:_wc_shipment_tracking_items]' === $content ) {
75 $shortcode = $content;
76 $textcolor = isset( $element['settingRow']['textColor'] ) ? ' textcolor=' . $element['settingRow']['textColor'] : '';
77 $bordercolor = isset( $element['settingRow']['borderColor'] ) ? ' bordercolor=' . $element['settingRow']['borderColor'] : '';
78 $titlecolor = isset( $element['settingRow']['titleColor'] ) ? ' titlecolor=' . $element['settingRow']['titleColor'] : '';
79 $fontfamily = isset( $element['settingRow']['family'] ) ? ' fontfamily=' . str_replace( ' ', '', str_replace( array( '\'', '"' ), '', $element['settingRow']['family'] ) ) : '';
80 $newshortcode = substr( $shortcode, 0, -1 );
81 $newshortcode .= $textcolor . $bordercolor . $titlecolor . $fontfamily . ']';
82 $content = str_replace( $shortcode, $newshortcode, $content );
83 $element['settingRow']['content'] = $content;
84 }
85 }
86 if ( has_filter( 'yaymail_addon_for_conditional_logic' ) && isset( $element['settingRow']['arrConditionLogic'] ) ) {
87 if ( ! empty( $element['settingRow']['arrConditionLogic'] ) ) {
88 $conditional_Logic = apply_filters( 'yaymail_addon_for_conditional_logic', false, $args, $element['settingRow'] );
89 if ( $conditional_Logic ) {
90 do_action( 'Yaymail' . $element['type'], $args, $element['settingRow'], $general_attrs, $element['id'], $postID, $isInColumns = false );
91 }
92 } else {
93 if ( 'OneColumn' === $element['type'] || 'TwoColumns' === $element['type'] || 'ThreeColumns' === $element['type'] || 'FourColumns' === $element['type'] ) {
94 for ( $column = 1; $column <= 4; $column++ ) {
95 if ( isset( $element['settingRow'][ 'column' . $column ] ) ) {
96 foreach ( $element['settingRow'][ 'column' . $column ] as $column_key => $column_element ) {
97 if ( isset( $column_element['settingRow']['arrConditionLogic'] ) && ! empty( $column_element['settingRow']['arrConditionLogic'] ) ) {
98 $conditional_Logic = apply_filters( 'yaymail_addon_for_conditional_logic', false, $args, $column_element['settingRow'] );
99 if ( ! $conditional_Logic ) {
100 unset( $element['settingRow'][ 'column' . $column ][ $column_key ] );
101 }
102 }
103 }
104 }
105 }
106 }
107 do_action( 'Yaymail' . $element['type'], $args, $element['settingRow'], $general_attrs, $element['id'], $postID, $isInColumns = false );
108 }
109 } else {
110 do_action( 'Yaymail' . $element['type'], $args, $element['settingRow'], $general_attrs, $element['id'], $postID, $isInColumns = false );
111 }
112 ?>
113 </td></tr>
114 <?php
115 }
116 ?>
117 </table>
118 </body>
119 </html>
120
121
122
123