PluginProbe
YayMail – WooCommerce Email Customizer / 3.3.4
YayMail – WooCommerce Email Customizer v3.3.4
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 / emails / customer-confirm-order.php

customer-confirm-order.php in YayMail – WooCommerce Email Customizer 3.3.4, at views/templates/emails/customer-confirm-order.php

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