PluginProbe
YayMail – WooCommerce Email Customizer / 3.2.2
YayMail – WooCommerce Email Customizer v3.2.2
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 / sepa.php

sepa.php in YayMail – WooCommerce Email Customizer 3.2.2, at views/templates/emails/sepa.php

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