Completed
Branch BUG-8372-txn-meta-box-errors (d9e527)
by
unknown
33:55 queued 16:24
created
default/email_not_approved_registration_attendee_list_admin.template.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <h4><a href="[EDIT_ATTENDEE_LINK]">[FNAME] [LNAME]</a></h4>
2 2
 <ul>
3 3
 	<li>
4
-		<strong><?php _e( 'Registration Code:', 'event_espresso' ); ?></strong>
4
+		<strong><?php _e('Registration Code:', 'event_espresso'); ?></strong>
5 5
 		<a href="[EDIT_ATTENDEE_LINK]">[REGISTRATION_CODE]</a>
6 6
 	</li>
7 7
 	<li>
8
-		<strong><?php _e( 'Tickets:', 'event_espresso' ); ?></strong>
8
+		<strong><?php _e('Tickets:', 'event_espresso'); ?></strong>
9 9
 		<ul>[TICKET_LIST]</ul>
10 10
 	</li>
11 11
 </ul>
Please login to merge, or discard this patch.
messages/defaults/default/email_pending_approval_event_list.template.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 		<tbody>
4 4
 			<tr>
5 5
 				<td>
6
-					<p class="callout"><strong><?php _e( 'Event:', 'event_espresso' ); ?> [EVENT_LINK]</strong></p>
6
+					<p class="callout"><strong><?php _e('Event:', 'event_espresso'); ?> [EVENT_LINK]</strong></p>
7 7
 				</td>
8 8
 			</tr>
9 9
 		</tbody>
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 			<tbody>
17 17
 				<tr>
18 18
 					<td>
19
-						<h3><?php _e( 'Registrant(s):', 'event_espresso' ); ?></h3>
19
+						<h3><?php _e('Registrant(s):', 'event_espresso'); ?></h3>
20 20
 						[ATTENDEE_LIST]
21 21
 					</td>
22 22
 				</tr>
Please login to merge, or discard this patch.
core/libraries/messages/message_type/EE_Invoice_message_type.class.php 3 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
 
34 34
 	protected function _set_admin_pages() {
35
-		$this->admin_registered_pages = array( 'events_edit' => TRUE );
35
+		$this->admin_registered_pages = array('events_edit' => TRUE);
36 36
 	}
37 37
 
38 38
 
@@ -45,17 +45,17 @@  discard block
 block discarded – undo
45 45
 
46 46
 	protected function _set_with_messengers() {
47 47
 		$this->_with_messengers = array(
48
-			'html' => array( 'pdf' )
48
+			'html' => array('pdf')
49 49
 			);
50 50
 	}
51 51
 
52 52
 
53 53
 
54
-	protected function _get_data_for_context( $context, EE_Registration $registration, $id ) {
54
+	protected function _get_data_for_context($context, EE_Registration $registration, $id) {
55 55
 		//receipt message type data handler is 'Gateways' and it expects a transaction object.
56 56
 		$transaction = $registration->transaction();
57
-		if ( $transaction instanceof EE_Transaction ) {
58
-			return array( $transaction );
57
+		if ($transaction instanceof EE_Transaction) {
58
+			return array($transaction);
59 59
 		}
60 60
 		return array();
61 61
 	}
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,9 @@
 block discarded – undo
5 5
  * @subpackage plugin api, messages
6 6
  * @since           4.5.0
7 7
  */
8
-if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
8
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
9
+	exit('No direct script access allowed');
10
+}
9 11
 
10 12
 /**
11 13
  * Use this to register or deregister a new message template pack variation for the EE messages system.
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -87,12 +87,12 @@
 block discarded – undo
87 87
 
88 88
 
89 89
 	/**
90
-	* used to set the valid shortcodes for the receipt message type
91
-	*
92
-	* @since   4.5.0
93
-	*
94
-	* @return  void
95
-	*/
90
+	 * used to set the valid shortcodes for the receipt message type
91
+	 *
92
+	 * @since   4.5.0
93
+	 *
94
+	 * @return  void
95
+	 */
96 96
 	protected function _set_valid_shortcodes() {
97 97
 		$this->_valid_shortcodes['purchaser'] = array(
98 98
 			'attendee_list', 'attendee', 'datetime_list', 'datetime', 'event_list', 'event', 'event_meta', 'messenger', 'organization', 'primary_registration_list', 'primary_registration_details', 'ticket_list', 'ticket', 'transaction', 'venue', 'line_item_list', 'payment_list', 'line_item', 'payment'
Please login to merge, or discard this patch.
messages/message_type/EE_Not_Approved_Registration_message_type.class.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('NO direct script access allowed');
5 5
 
6 6
 /**
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
libraries/messages/message_type/EE_Payment_Refund_message_type.class.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('NO direct script access allowed');
5 5
 
6 6
 /**
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
core/libraries/messages/message_type/EE_Payment_message_type.class.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('NO direct script access allowed');
5 5
 
6 6
 /**
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
libraries/messages/message_type/EE_Pending_Approval_message_type.class.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('NO direct script access allowed');
5 5
 
6 6
 /**
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
messages/message_type/EE_Registration_Summary_message_type.class.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('NO direct script access allowed');
5 5
 
6 6
 /**
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
core/libraries/messages/messenger/EE_Email_messenger.class.php 3 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@
 block discarded – undo
93 93
 	 *
94 94
 	 * @abstract
95 95
 	 * @access protected
96
-	 * @return array
96
+	 * @return string[]
97 97
 	 */
98 98
 	protected function _get_table_filters() {
99 99
 		$filters = array();
Please login to merge, or discard this patch.
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('NO direct script access allowed');
5 5
 
6 6
 /**
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 /**
30 30
  * This sets up the email messenger for the EE_messages (notifications) subsystem in EE.
31 31
  */
32
-class EE_Email_messenger extends EE_messenger  {
32
+class EE_Email_messenger extends EE_messenger {
33 33
 
34 34
 	/**
35 35
 	 * The following are the properties that email requires for the message going out.
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	protected function _set_valid_shortcodes() {
78 78
 		//remember by leaving the other fields not set, those fields will inherit the valid shortcodes from the message type.
79 79
 		$this->_valid_shortcodes = array(
80
-			'to' => array('email','event_author', 'primary_registration_details', 'recipient_details'),
80
+			'to' => array('email', 'event_author', 'primary_registration_details', 'recipient_details'),
81 81
 			'from' => array('email', 'event_author', 'primary_registration_details', 'recipient_details')
82 82
 			);
83 83
 	}
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 				'shortcodes' => array('organization', 'primary_registration_details', 'event_author', 'primary_registration_details', 'recipient_details')
112 112
 				),
113 113
 			'content' => array(
114
-				'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'primary_registration_details', 'primary_registration_list', 'event_author', 'recipient_details', 'recipient_list', 'transaction', 'messenger')
114
+				'shortcodes' => array('event_list', 'attendee_list', 'ticket_list', 'organization', 'primary_registration_details', 'primary_registration_list', 'event_author', 'recipient_details', 'recipient_list', 'transaction', 'messenger')
115 115
 				),
116 116
 			'attendee_list' => array(
117 117
 				'shortcodes' => array('attendee', 'event_list', 'ticket_list'),
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 				'required' => array('[EVENT_LIST]')
123 123
 				),
124 124
 			'ticket_list' => array(
125
-				'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list','primary_registration_details', 'recipient_details'),
125
+				'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'primary_registration_details', 'recipient_details'),
126 126
 				'required' => array('[TICKET_LIST]')
127 127
 				),
128 128
 			'datetime_list' => array(
@@ -141,21 +141,21 @@  discard block
 block discarded – undo
141 141
 	 *
142 142
 	 * @since 4.5.0
143 143
 	 */
144
-	public function do_secondary_messenger_hooks( $sending_messenger_name ) {
145
-		if ( $sending_messenger_name = 'html' ) {
146
-			add_filter( 'FHEE__EE_Messages_Template_Pack__get_variation', array( $this, 'add_email_css' ), 10, 8 );
144
+	public function do_secondary_messenger_hooks($sending_messenger_name) {
145
+		if ($sending_messenger_name = 'html') {
146
+			add_filter('FHEE__EE_Messages_Template_Pack__get_variation', array($this, 'add_email_css'), 10, 8);
147 147
 		}
148 148
 	}
149 149
 
150 150
 
151 151
 
152 152
 
153
-	public function add_email_css( $variation_path, $messenger, $message_type, $type, $variation, $file_extension, $url, EE_Messages_Template_Pack $template_pack ) {
153
+	public function add_email_css($variation_path, $messenger, $message_type, $type, $variation, $file_extension, $url, EE_Messages_Template_Pack $template_pack) {
154 154
 		//prevent recursion on this callback.
155
-		remove_filter( 'FHEE__EE_Messages_Template_Pack__get_variation', array( $this, 'add_email_css' ), 10 );
156
-		$variation = $this->get_variation( $template_pack, $message_type, $url, 'main', $variation, FALSE  );
155
+		remove_filter('FHEE__EE_Messages_Template_Pack__get_variation', array($this, 'add_email_css'), 10);
156
+		$variation = $this->get_variation($template_pack, $message_type, $url, 'main', $variation, FALSE);
157 157
 
158
-		add_filter( 'FHEE__EE_Messages_Template_Pack__get_variation', array( $this, 'add_email_css' ), 10, 8 );
158
+		add_filter('FHEE__EE_Messages_Template_Pack__get_variation', array($this, 'add_email_css'), 10, 8);
159 159
 		return $variation;
160 160
 	}
161 161
 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 				'required' => FALSE,
188 188
 				'validation' => FALSE,
189 189
 				'format' => '%s',
190
-				'value' => sprintf( __('Test email sent from %s', 'event_espresso'), get_bloginfo('name') ),
190
+				'value' => sprintf(__('Test email sent from %s', 'event_espresso'), get_bloginfo('name')),
191 191
 				'default'=> '',
192 192
 				'css_class' => ''
193 193
 				)
@@ -349,16 +349,16 @@  discard block
 block discarded – undo
349 349
 	 * @return bool | WP_Error  true if message delivered, false if it didn't deliver OR bubble up any error object if present.
350 350
 	 */
351 351
 	protected function _send_message() {
352
-		$success =  wp_mail(
353
-			html_entity_decode( $this->_to, ENT_QUOTES, "UTF-8" ),
354
-			stripslashes( html_entity_decode( $this->_subject, ENT_QUOTES, "UTF-8" )),
352
+		$success = wp_mail(
353
+			html_entity_decode($this->_to, ENT_QUOTES, "UTF-8"),
354
+			stripslashes(html_entity_decode($this->_subject, ENT_QUOTES, "UTF-8")),
355 355
 			$this->_body(),
356 356
 			$this->_headers()
357 357
 		);
358
-		if ( ! $success ) {
358
+		if ( ! $success) {
359 359
 			EE_Error::add_error(
360 360
 				sprintf(
361
-					__( 'The email did not send successfully.%3$sThe WordPress wp_mail function is used for sending mails but does not give any useful information when an email fails to send.%3$sIt is possible the "to" address (%1$s) or "from" address (%2$s) is invalid.%3$s', 'event_espresso'),
361
+					__('The email did not send successfully.%3$sThe WordPress wp_mail function is used for sending mails but does not give any useful information when an email fails to send.%3$sIt is possible the "to" address (%1$s) or "from" address (%2$s) is invalid.%3$s', 'event_espresso'),
362 362
 					$this->_to,
363 363
 					$this->_from,
364 364
 					'<br />'
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 	 * @return string html body of the message content and the related css.
378 378
 	 */
379 379
 	protected function _preview() {
380
-		return $this->_body( true );
380
+		return $this->_body(true);
381 381
 	}
382 382
 
383 383
 
@@ -391,18 +391,18 @@  discard block
 block discarded – undo
391 391
 	 * @return string formatted header for email
392 392
 	 */
393 393
 	protected function _headers() {
394
-		$from = stripslashes_deep( html_entity_decode($this->_from,  ENT_QUOTES,"UTF-8" ) );
394
+		$from = stripslashes_deep(html_entity_decode($this->_from, ENT_QUOTES, "UTF-8"));
395 395
 		$headers = array(
396 396
 			'MIME-Version: 1.0',
397
-			'From:' . $from,
398
-			'Reply-To:' . $from,
397
+			'From:'.$from,
398
+			'Reply-To:'.$from,
399 399
 			'Content-Type:text/html; charset=utf-8'
400 400
 			);
401 401
 
402 402
 		//but wait!  Header's for the from is NOT reliable because some plugins don't respect From: as set in the header.
403
-		add_filter( 'wp_mail_from',  array( $this, 'set_from_address' ), 100 );
404
-		add_filter( 'wp_mail_from_name', array( $this, 'set_from_name' ), 100 );
405
-		return apply_filters( 'FHEE__EE_Email_messenger___headers', $headers, $this->_incoming_message_type, $this );
403
+		add_filter('wp_mail_from', array($this, 'set_from_address'), 100);
404
+		add_filter('wp_mail_from_name', array($this, 'set_from_name'), 100);
405
+		return apply_filters('FHEE__EE_Email_messenger___headers', $headers, $this->_incoming_message_type, $this);
406 406
 	}
407 407
 
408 408
 
@@ -418,19 +418,19 @@  discard block
 block discarded – undo
418 418
 	 * @return array
419 419
 	 */
420 420
 	private function _parse_from() {
421
-		if ( strpos( $this->_from, '<' ) !== false ) {
422
-			$from_name = substr( $this->_from, 0, strpos( $this->_from, '<' ) - 1 );
423
-			$from_name = str_replace( '"', '', $from_name );
424
-			$from_name = trim( $from_name );
425
-
426
-			$from_email = substr( $this->_from, strpos( $this->_from, '<' ) + 1 );
427
-			$from_email = str_replace( '>', '', $from_email );
428
-			$from_email = trim( $from_email );
421
+		if (strpos($this->_from, '<') !== false) {
422
+			$from_name = substr($this->_from, 0, strpos($this->_from, '<') - 1);
423
+			$from_name = str_replace('"', '', $from_name);
424
+			$from_name = trim($from_name);
425
+
426
+			$from_email = substr($this->_from, strpos($this->_from, '<') + 1);
427
+			$from_email = str_replace('>', '', $from_email);
428
+			$from_email = trim($from_email);
429 429
 		} else {
430 430
 			$from_name = '';
431
-			$from_email = trim( $this->_from );
431
+			$from_email = trim($this->_from);
432 432
 		}
433
-		return array( $from_name, $from_email );
433
+		return array($from_name, $from_email);
434 434
 	}
435 435
 
436 436
 
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
 	 *
444 444
 	 * @param string $from_email What the original from_email is.
445 445
 	 */
446
-	public function set_from_address( $from_email ) {
446
+	public function set_from_address($from_email) {
447 447
 		$parsed_from = $this->_parse_from();
448 448
 		return $parsed_from[1];
449 449
 	}
@@ -458,13 +458,13 @@  discard block
 block discarded – undo
458 458
 	 *
459 459
 	 * @param string $from_name The original from_name.
460 460
 	 */
461
-	public function set_from_name( $from_name ) {
461
+	public function set_from_name($from_name) {
462 462
 		$parsed_from = $this->_parse_from();
463
-		if ( is_array( $parsed_from) && ! empty( $parsed_from[0] ) ) {
464
-			$from_name =  $parsed_from[0];
463
+		if (is_array($parsed_from) && ! empty($parsed_from[0])) {
464
+			$from_name = $parsed_from[0];
465 465
 		}
466 466
 
467
-		return stripslashes_deep( html_entity_decode($from_name,  ENT_QUOTES,"UTF-8" ) );
467
+		return stripslashes_deep(html_entity_decode($from_name, ENT_QUOTES, "UTF-8"));
468 468
 	}
469 469
 
470 470
 
@@ -475,14 +475,14 @@  discard block
 block discarded – undo
475 475
 	 * @param bool $preview will determine whether this is preview template or not.
476 476
 	 * @return string formatted body for email.
477 477
 	 */
478
-	protected function _body( $preview = false ) {
478
+	protected function _body($preview = false) {
479 479
 		//setup template args!
480 480
 		$this->_template_args = array(
481 481
 			'subject' => $this->_subject,
482 482
 			'from' => $this->_from,
483
-			'main_body' => wpautop(stripslashes_deep( html_entity_decode($this->_content,  ENT_QUOTES,"UTF-8" ) ))
483
+			'main_body' => wpautop(stripslashes_deep(html_entity_decode($this->_content, ENT_QUOTES, "UTF-8")))
484 484
 			);
485
-		$body =  $this->_get_main_template( $preview );
485
+		$body = $this->_get_main_template($preview);
486 486
 
487 487
 		/**
488 488
 		 * This filter allows one to bypass the CSSToInlineStyles tool and leave the body untouched.
@@ -490,17 +490,17 @@  discard block
 block discarded – undo
490 490
 		 * @type    bool    $preview    Indicates whether a preview is being generated or not.
491 491
 		 * @return  bool    true  indicates to use the inliner, false bypasses it.
492 492
 		 */
493
-		if ( apply_filters( 'FHEE__EE_Email_messenger__apply_CSSInliner ', true, $preview ) ) {
493
+		if (apply_filters('FHEE__EE_Email_messenger__apply_CSSInliner ', true, $preview)) {
494 494
 
495 495
 			//require CssToInlineStyles library and its dependencies via composer autoloader
496
-			require_once EE_THIRD_PARTY . 'cssinliner/vendor/autoload.php';
496
+			require_once EE_THIRD_PARTY.'cssinliner/vendor/autoload.php';
497 497
 
498 498
 			//now if this isn't a preview, let's setup the body so it has inline styles
499
-			if ( ! $preview || ( $preview && defined( 'DOING_AJAX' ) ) ) {
500
-				$style = file_get_contents( $this->get_variation( $this->_tmp_pack, $this->_incoming_message_type->name, FALSE, 'main', $this->_variation ), TRUE );
501
-				$CSS = new TijsVerkoyen\CssToInlineStyles\CssToInlineStyles( $body, $style );
502
-				$body = ltrim( $CSS->convert( true ), ">\n" ); //for some reason the library has a bracket and new line at the beginning.  This takes care of that.
503
-				$body = ltrim( $body, "<?" ); //see https://events.codebasehq.com/projects/event-espresso/tickets/8609
499
+			if ( ! $preview || ($preview && defined('DOING_AJAX'))) {
500
+				$style = file_get_contents($this->get_variation($this->_tmp_pack, $this->_incoming_message_type->name, FALSE, 'main', $this->_variation), TRUE);
501
+				$CSS = new TijsVerkoyen\CssToInlineStyles\CssToInlineStyles($body, $style);
502
+				$body = ltrim($CSS->convert(true), ">\n"); //for some reason the library has a bracket and new line at the beginning.  This takes care of that.
503
+				$body = ltrim($body, "<?"); //see https://events.codebasehq.com/projects/event-espresso/tickets/8609
504 504
 			}
505 505
 
506 506
 		}
@@ -519,8 +519,8 @@  discard block
 block discarded – undo
519 519
 	public function get_existing_test_settings() {
520 520
 		$settings = parent::get_existing_test_settings();
521 521
 		//override subject if present because we always want it to be fresh.
522
-		if ( is_array( $settings ) && ! empty( $settings['subject'] ) ) {
523
-			$settings['subject'] = sprintf( __('Test email sent from %s', 'event_espresso'), get_bloginfo('name') );
522
+		if (is_array($settings) && ! empty($settings['subject'])) {
523
+			$settings['subject'] = sprintf(__('Test email sent from %s', 'event_espresso'), get_bloginfo('name'));
524 524
 		}
525 525
 		return $settings;
526 526
 	}
Please login to merge, or discard this patch.