PluginProbe
YayMail – WooCommerce Email Customizer / 3.2.9
YayMail – WooCommerce Email Customizer v3.2.9
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 / double-opt-in-customer-registration.php

double-opt-in-customer-registration.php in YayMail – WooCommerce Email Customizer 3.2.9, at views/templates/emails/double-opt-in-customer-registration.php

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