PluginProbe
YayMail – WooCommerce Email Customizer / 3.2.6
YayMail – WooCommerce Email Customizer v3.2.6
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 / single-follow-up-mail-template.php

single-follow-up-mail-template.php in YayMail – WooCommerce Email Customizer 3.2.6, at views/templates/single-follow-up-mail-template.php

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