Completed
Push — issues/611 ( f3b0b1...9fa10b )
by Ravinder
35:42 queued 15:49
created

Give_Email_Notification::send_preview_email()   B

Complexity

Conditions 3
Paths 4

Size

Total Lines 24
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 13
nc 4
nop 0
dl 0
loc 24
rs 8.9713
c 0
b 0
f 0
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 27 and the first side effect is on line 16.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
/**
3
 * Email Notification
4
 *
5
 * This class handles all email notification settings.
6
 *
7
 * @package     Give
8
 * @subpackage  Classes/Emails
9
 * @copyright   Copyright (c) 2016, WordImpress
10
 * @license     https://opensource.org/licenses/gpl-license GNU Public License
11
 * @since       2.0
12
 */
13
14
// Exit if access directly.
15
if ( ! defined( 'ABSPATH' ) ) {
16
	exit;
17
}
18
19
if ( ! class_exists( 'Give_Email_Notification' ) ) :
20
21
	/**
22
	 * Give_Email_Notification
23
	 *
24
	 * @abstract
25
	 * @since       2.0
26
	 */
27
	abstract class Give_Email_Notification {
28
		/**
29
		 * Array of instances
30
		 *
31
		 * @since  2.0
32
		 * @access private
33
		 * @var array
34
		 */
35
		private static $singleton = array();
36
37
38
		/**
39
		 * Array of notification settings.
40
		 *
41
		 * @since  2.0
42
		 * @access public
43
		 * @var array
44
		 */
45
		public $config = array(
46
			'id'                           => '',
47
			'label'                        => '',
48
			'description'                  => '',
49
			'has_recipient_field'          => false,
50
			'recipient_group_name'         => '',
51
			'notification_status'          => 'disabled',
52
			'notification_status_editable' => true,
53
			'has_preview'                  => true,
54
			'has_preview_header'           => true,
55
			'preview_email_tags_values'    => array(),
56
			'email_tag_context'            => 'all',
57
			'form_metabox_setting'         => true,
58
			'content_type'                 => '',
59
			'default_email_subject'        => '',
60
			'default_email_message'        => '',
61
		);
62
63
		/**
64
		 * @var     string $recipient_email Donor email.
65
		 * @access  protected
66
		 * @since   2.0
67
		 */
68
		protected $recipient_email = '';
69
70
71
		/**
72
		 * Setup email notification.
73
		 *
74
		 * @since 2.0
75
		 */
76
		public function init() {
77
78
		}
79
80
81
		/**
82
		 * Get instance.
83
		 *
84
		 * @since  2.0
85
		 * @access public
86
		 * @return Give_Email_Notification
87
		 */
88
		public static function get_instance() {
89
			$class = get_called_class();
90
			if ( ! array_key_exists( $class, self::$singleton ) || is_null( self::$singleton[ $class ] ) ) {
91
				self::$singleton[ $class ] = new $class();
92
			}
93
94
			return self::$singleton[ $class ];
95
		}
96
97
		/**
98
		 * Setup action and filters.
99
		 *
100
		 * @access  public
101
		 * @since   2.0
102
		 *
103
		 * @param array $config
104
		 */
105
		public function load( $config ) {
106
			// Set notification configuration.
107
			$this->config = wp_parse_args( $config, $this->config );
108
109
			// Set email preview header status.
110
			$this->config['has_preview_header'] = $this->config['has_preview'] && $this->config['has_preview_header'] ? true : false;
111
112
			// Set email content type
113
			$this->config['content_type'] = empty( $this->config['content_type'] ) || ! in_array( $this->config['content_type'], array( 'text/html', 'text/plain', ) )
114
				? Give()->emails->get_content_type()
115
				: $this->config['content_type'];
116
			$this->config['content_type'] = give_get_option( "{$this->config['id']}_email_content_type", $this->config['content_type'] );
117
118
			/**
119
			 *  Filter the notification config.
120
			 *
121
			 * @since 2.0
122
			 *
123
			 * @param                         array                   Give_Email_Notification::config
124
			 * @param Give_Email_Notification $this
125
			 */
126
			$this->config = apply_filters( 'give_email_api_notification_config', $this->config, $this );
127
128
			// Setup filters.
129
			$this->setup_filters();
130
		}
131
132
133
		/**
134
		 * Setup filters.
135
		 *
136
		 * @since  2.0
137
		 * @access public
138
		 */
139
		private function setup_filters() {
140
			// Apply filter only for current email notification section.
141
			if ( give_get_current_setting_section() === $this->config['id'] ) {
142
				// Initialize email context for email notification.
143
				$this->config['email_tag_context'] = apply_filters(
144
					"give_{$this->config['id']}_email_tag_context",
145
					$this->config['email_tag_context'],
146
					$this
147
				);
148
			}
149
150
			// Setup setting fields.
151
			add_filter( 'give_get_settings_emails', array( $this, 'add_setting_fields' ), 10, 2 );
152
153
			if ( $this->config['form_metabox_setting'] ) {
154
				add_filter(
155
					'give_email_notification_options_metabox_fields',
156
					array( $this, 'add_metabox_setting_field' ),
157
					10,
158
					2
159
				);
160
			}
161
162
			/**
163
			 * Filter the default email subject.
164
			 *
165
			 * @since 2.0
166
			 */
167
			$this->config['default_email_subject'] = apply_filters(
168
				"give_{$this->config['id']}_get_default_email_subject",
169
				$this->config['default_email_subject'],
170
				$this
171
			);
172
173
			/**
174
			 * Filter the default email message.
175
			 *
176
			 * @since 2.0
177
			 */
178
			$this->config['default_email_message'] = apply_filters(
179
				"give_{$this->config['id']}_get_default_email_message",
180
				$this->config['default_email_message'],
181
				$this
182
			);
183
		}
184
185
		/**
186
		 * Add sections.
187
		 *
188
		 * @since 2.0
189
		 *
190
		 * @param array $sections
191
		 *
192
		 * @return array
193
		 */
194
		public function add_section( $sections ) {
195
			$sections[ $this->config['id'] ] = $this->config['label'];
196
197
			return $sections;
198
		}
199
200
		/**
201
		 * Add sections.
202
		 *
203
		 * @since 2.0
204
		 *
205
		 * @param bool $hide_section
206
		 *
207
		 * @return bool
208
		 */
209
		public function hide_section( $hide_section ) {
0 ignored issues
show
Unused Code introduced by
The parameter $hide_section is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
210
			$hide_section = true;
211
212
			return $hide_section;
213
		}
214
215
		/**
216
		 * Register email settings.
217
		 *
218
		 * @since  2.0
219
		 * @access public
220
		 *
221
		 * @param   array $settings
222
		 *
223
		 * @return  array
224
		 */
225
		public function add_setting_fields( $settings ) {
226
			if ( $this->config['id'] === give_get_current_setting_section() ) {
227
				$settings = $this->get_setting_fields();
228
			}
229
230
			return $settings;
231
		}
232
233
234
		/**
235
		 * Get setting fields
236
		 *
237
		 * @since  2.0
238
		 * @access public
239
		 *
240
		 * @param int $form_id
241
		 *
242
		 * @return array
243
		 */
244
		public function get_setting_fields( $form_id = null ) {
245
			return Give_Email_Setting_Field::get_setting_fields( $this, $form_id );
246
		}
247
248
249
		/**
250
		 * Register email settings to form metabox.
251
		 *
252
		 * @since  2.0
253
		 * @access public
254
		 *
255
		 * @param array $settings
256
		 * @param int   $form_id
257
		 *
258
		 * @return array
259
		 */
260
		public function add_metabox_setting_field( $settings, $form_id ) {
261
262
			$settings[] = array(
263
				'id'     => $this->config['id'],
264
				'title'  => $this->config['label'],
265
				'fields' => $this->get_setting_fields( $form_id ),
266
			);
267
268
			return $settings;
269
		}
270
271
272
		/**
273
		 * Get extra setting field.
274
		 *
275
		 * @since  2.0
276
		 * @access public
277
		 *
278
		 * @param int $form_id
279
		 *
280
		 * @return array
281
		 */
282
		public function get_extra_setting_fields( $form_id = null ) {
0 ignored issues
show
Unused Code introduced by
The parameter $form_id is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
283
			return array();
284
		}
285
286
287
		/**
288
		 * Get recipient(s).
289
		 *
290
		 * Note: in case of admin notification this fx will return array of emails otherwise empty string or email of donor.
291
		 *
292
		 * @since  2.0
293
		 * @access public
294
		 *
295
		 * @param int $form_id
296
		 *
297
		 * @return string|array
298
		 */
299
		public function get_recipient( $form_id = null ) {
300
			if ( empty( $this->recipient_email ) && $this->config['has_recipient_field'] ) {
301
				$this->recipient_email = Give_Email_Notification_Util::get_value( $this, "{$this->config['id']}_recipient", $form_id );
302
			}
303
304
			/**
305
			 * Filter the recipients
306
			 *
307
			 * @since 2.0
308
			 */
309
			return apply_filters(
310
				"give_{$this->config['id']}_get_recipients",
311
				give_check_variable(
312
					$this->recipient_email,
313
					'empty',
314
					Give()->emails->get_from_address()
315
				),
316
				$this,
317
				$form_id
318
			);
319
		}
320
321
		/**
322
		 * Get notification status.
323
		 *
324
		 * @since  2.0
325
		 * @access public
326
		 *
327
		 * @param int $form_id
328
		 *
329
		 * @return bool
330
		 */
331
		public function get_notification_status( $form_id = null ) {
332
			$notification_status = empty( $form_id )
333
				? give_get_option( "{$this->config['id']}_notification", $this->config['notification_status'] )
334
				: get_post_meta( $form_id,"{$this->config['id']}_notification", true  );
335
336
			/**
337
			 * Filter the notification status.
338
			 *
339
			 * @since 1.8
340
			 */
341
			return apply_filters(
342
				"give_{$this->config['id']}_get_notification_status",
343
				$notification_status,
344
				$this,
345
				$form_id
346
			);
347
		}
348
349
		/**
350
		 * Get email subject.
351
		 *
352
		 * @since  2.0
353
		 * @access public
354
		 *
355
		 * @param int $form_id
356
		 *
357
		 * @return string
358
		 */
359
		function get_email_subject( $form_id = null ) {
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
360
			$subject = wp_strip_all_tags(
361
				Give_Email_Notification_Util::get_value(
362
					$this,
363
					"{$this->config['id']}_email_subject",
364
					$form_id,
365
					$this->config['default_email_subject']
366
				)
367
			);
368
369
			/**
370
			 * Filter the subject.
371
			 *
372
			 * @since 2.0
373
			 */
374
			return apply_filters(
375
				"give_{$this->config['id']}_get_email_subject",
376
				$subject,
377
				$this,
378
				$form_id
379
			);
380
		}
381
382
		/**
383
		 * Get email message.
384
		 *
385
		 * @since  2.0
386
		 * @access public
387
		 *
388
		 * @param int $form_id
389
		 *
390
		 * @return string
391
		 */
392
		public function get_email_message( $form_id = null ) {
393
			$message = Give_Email_Notification_Util::get_value(
394
				$this,
395
				"{$this->config['id']}_email_message",
396
				$form_id,
397
				$this->config['default_email_message']
398
			);
399
400
			/**
401
			 * Filter the message.
402
			 *
403
			 * @since 2.0
404
			 */
405
			return apply_filters(
406
				"give_{$this->config['id']}_get_email_message",
407
				$message,
408
				$this,
409
				$form_id
410
			);
411
		}
412
413
414
		/**
415
		 * Get meial content type.
416
		 *
417
		 * @since 2.0
418
		 * @access public
419
		 *
420
		 * @param $form_id
421
		 *
422
		 * @return string
423
		 */
424
		public function get_email_content_type( $form_id ) {
425
			$content_type = Give_Email_Notification_Util::get_value(
426
				$this,
427
				"{$this->config['id']}_email_content_type",
428
				$form_id,
429
				$this->config['content_type']
430
			);
431
432
			/**
433
			 * Filter the email content type.
434
			 *
435
			 * @since 2.0
436
			 */
437
			return apply_filters(
438
				"give_{$this->config['id']}_get_email_message",
439
				$content_type,
440
				$this,
441
				$form_id
442
			);
443
		}
444
445
446
		/**
447
		 * Get allowed email tags for current email notification.
448
		 *
449
		 * @since  2.0
450
		 * @access private
451
		 *
452
		 * @param bool $formatted
453
		 *
454
		 * @return array
0 ignored issues
show
Documentation introduced by
Should the return type not be string|array?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
455
		 */
456
		public function get_allowed_email_tags( $formatted = false ) {
457
			// Get all email tags.
458
			$email_tags = Give()->email_tags->get_tags();
459
460
			// Skip if all email template tags context setup exit.
461
			if ( $this->config['email_tag_context'] && 'all' !== $this->config['email_tag_context'] ) {
462
				if ( is_array( $this->config['email_tag_context'] ) ) {
463
					foreach ( $email_tags as $index => $email_tag ) {
464
						if ( in_array( $email_tag['context'], $this->config['email_tag_context'] ) ) {
465
							continue;
466
						}
467
468
						unset( $email_tags[ $index ] );
469
					}
470
				} else {
471
					foreach ( $email_tags as $index => $email_tag ) {
472
						if ( $this->config['email_tag_context'] === $email_tag['context'] ) {
473
							continue;
474
						}
475
476
						unset( $email_tags[ $index ] );
477
					}
478
				}
479
			}
480
481
			if ( count( $email_tags ) && $formatted ) : ob_start() ?>
482
				<div class="give-email-tags-wrap">
483
					<?php foreach ( $email_tags as $email_tag ) : ?>
484
						<span class="give_<?php echo $email_tag['tag']; ?>_tag">
485
							<code>{<?php echo $email_tag['tag']; ?>}</code> - <?php echo $email_tag['description']; ?>
486
						</span>
487
					<?php endforeach; ?>
488
				</div>
489
				<?php
490
				$email_tags = ob_get_clean();
491
			endif;
492
493
			return $email_tags;
494
		}
495
496
		/**
497
		 * Get preview email recipients.
498
		 *
499
		 * @since  2.0
500
		 * @access public
501
		 *
502
		 * @param int $form_id
503
		 * @return array|string
504
		 */
505
		public function get_preview_email_recipient( $form_id = null ) {
506
			$recipients = $this->get_recipient( $form_id );
507
508
			/**
509
			 * Filter the preview email recipients.
510
			 *
511
			 * @since 2.0
512
			 *
513
			 * @param string|array            $recipients List of recipients.
514
			 * @param Give_Email_Notification $this
515
			 */
516
			$recipients = apply_filters( 'give_get_preview_email_recipient', $recipients, $this, $form_id );
517
518
			return $recipients;
519
		}
520
521
		/**
522
		 * Get the recipient attachments.
523
		 *
524
		 * @since  2.0
525
		 * @access public
526
		 *
527
		 * @param int $form_id
528
		 * @return array
529
		 */
530
		public function get_email_attachments( $form_id = null ) {
531
			/**
532
			 * Filter the attachment.
533
			 *
534
			 * @since 2.0
535
			 */
536
			return apply_filters( "give_{$this->config['id']}_get_email_attachments", array(), $this, $form_id );
537
		}
538
539
540
		/**
541
		 * Send preview email.
542
		 *
543
		 * @since  2.0
544
		 * @access public
545
		 */
546
		public function send_preview_email() {
547
			// Get form id
548
			$form_id = ! empty( $_GET['form_id'] ) ? absint( $_GET['form_id'] ) : null;
549
550
			// setup email data.
551
			$this->setup_email_data();
552
553
			$attachments  = $this->get_email_attachments();
554
			$message      = $this->preview_email_template_tags( $this->get_email_message( $form_id ) );
555
			$subject      = $this->preview_email_template_tags( $this->get_email_subject( $form_id ) );
556
			$content_type = $this->get_email_content_type( $form_id );
557
558
			// Setup email content type.
559
			Give()->emails->__set( 'content_type', $content_type );
560
561
			// Format plain content type email.
562
			if ( 'text/plain' === $content_type ) {
563
				Give()->emails->__set( 'html', false );
564
				Give()->emails->__set( 'template', 'none' );
565
				$message = strip_tags( $message );
566
			}
567
568
			return Give()->emails->send( $this->get_preview_email_recipient( $form_id ), $subject, $message, $attachments );
569
		}
570
571
572
		/**
573
		 * Send email notification.
574
		 *
575
		 * Note: To render email tags in all context certain parameters are necessary for core (includes/emails/class-give-emails):
576
		 * 	1. payment_id
577
		 * 	2. user_id
578
		 * 	3. form_id
579
		 * 	4. donor_id
580
		 * 	5. for third party email tags you can pass necessary param along above parameters other value replace by empty string.
581
		 *
582
		 * @since  2.0
583
		 * @access public
584
		 *
585
		 * @param array $email_tag_args Arguments which helps to decode email template tags.
586
		 *
587
		 * @return bool
588
		 */
589
		public function send_email_notification( $email_tag_args = array() ) {
590
			// Add email content type email tags.
591
			$email_tag_args['email_content_type'] = $this->config['content_type'];
592
593
			/**
594
			 * Filter the email tag args
595
			 *
596
			 * @since 2.0
597
			 */
598
			$email_tag_args = apply_filters( "give_{$this->config['id']}_email_tag_args", $email_tag_args, $this );
599
600
			// Get form id.
601
			$form_id = ! empty( $email_tag_args['form_id'] )
602
				? absint( $email_tag_args['form_id'] )
603
				: ( ! empty( $email_tag_args['payment_id'] ) ? give_get_payment_form_id( $email_tag_args['payment_id'] ) : null );
604
605
606
			// Do not send email if notification is disable.
607
			if ( ! Give_Email_Notification_Util::is_email_notification_active( $this, $form_id ) ) {
608
				return false;
609
			}
610
611
			/**
612
			 * Fire action after before email send.
613
			 *
614
			 * @since 2.0
615
			 */
616
			do_action( "give_{$this->config['id']}_email_send_before", $this, $form_id );
617
618
			$attachments  = $this->get_email_attachments();
619
			$message      = give_do_email_tags( $this->get_email_message( $form_id ), $email_tag_args );
620
			$subject      = give_do_email_tags( $this->get_email_subject( $form_id ), $email_tag_args );
621
			$content_type = $this->get_email_content_type( $form_id );
622
623
			// Setup email content type.
624
			Give()->emails->__set( 'content_type', $content_type );
625
626
			if ( 'text/plain' === $content_type ) {
627
				Give()->emails->__set( 'html', false );
628
				Give()->emails->__set( 'template', 'none' );
629
				$message = strip_tags( $message );
630
			}
631
632
			// Send email.
633
			$email_status = Give()->emails->send( $this->get_recipient( $form_id ), $subject, $message, $attachments );
634
635
			/**
636
			 * Fire action after after email send.
637
			 *
638
			 * @since 2.0
639
			 */
640
			do_action( "give_{$this->config['id']}_email_send_after", $email_status, $this, $form_id );
641
642
			return $email_status;
643
		}
644
645
646
		/**
647
		 * Decode preview email template tags.
648
		 *
649
		 * @since 2.0
650
		 *
651
		 * @param string $message
652
		 *
653
		 * @return string
654
		 */
655
		public function preview_email_template_tags( $message ) {
656
			// Set Payment.
657
			$payment_id = give_check_variable( give_clean( $_GET ), 'isset_empty', 0, 'preview_id' );
658
			$payment    = $payment_id ? new Give_Payment( $payment_id ) : new stdClass();
659
660
			// Set donor.
661
			$user_id = $payment_id
662
				? $payment->user_id
663
				: give_check_variable( give_clean( $_GET ), 'isset_empty', 0, 'user_id' );
664
			$user_id = $user_id ? $user_id : wp_get_current_user()->ID;
665
666
			// Set receipt.
667
			$receipt_id = strtolower( md5( uniqid() ) );
668
669
			$receipt_link_url = esc_url( add_query_arg( array(
670
				'payment_key' => $receipt_id,
671
				'give_action' => 'view_receipt',
672
			), home_url() ) );
673
674
			$receipt_link = sprintf(
675
				'<a href="%1$s">%2$s</a>',
676
				$receipt_link_url,
677
				esc_html__( 'View the receipt in your browser &raquo;', 'give' )
678
			);
679
680
			// Set default values for tags.
681
			$this->config['preview_email_tags_values'] = wp_parse_args(
682
				$this->config['preview_email_tags_values'],
683
				array(
684
					'name'              => give_email_tag_first_name( array(
685
						'payment_id' => $payment_id,
686
						'user_id'    => $user_id,
687
					) ),
688
					'fullname'          => give_email_tag_fullname( array(
689
						'payment_id' => $payment_id,
690
						'user_id'    => $user_id,
691
					) ),
692
					'username'          => give_email_tag_username( array(
693
						'payment_id' => $payment_id,
694
						'user_id'    => $user_id,
695
					) ),
696
					'user_email'        => give_email_tag_user_email( array(
697
						'payment_id' => $payment_id,
698
						'user_id'    => $user_id,
699
					) ),
700
					'payment_total'     => $payment_id ? give_email_tag_payment_total( array( 'payment_id' => $payment_id ) ) : give_currency_filter( '10.50' ),
701
					'amount'            => $payment_id ? give_email_tag_amount( array( 'payment_id' => $payment_id ) ) : give_currency_filter( '10.50' ),
702
					'price'             => $payment_id ? give_email_tag_price( array( 'payment_id' => $payment_id ) ) : give_currency_filter( '10.50' ),
703
					'payment_method'    => $payment_id ? give_email_tag_payment_method( array( 'payment_id' => $payment_id ) ) : __( 'PayPal', 'give' ),
704
					'receipt_id'        => $receipt_id,
705
					'payment_id'        => $payment_id ? $payment_id : rand( 2000, 2050 ),
706
					'receipt_link_url'  => $receipt_link_url,
707
					'receipt_link'      => $receipt_link,
708
					'date'              => $payment_id ? date( give_date_format(), strtotime( $payment->date ) ) : date( give_date_format(), current_time( 'timestamp' ) ),
709
					'donation'          => $payment_id ? give_email_tag_donation( array( 'payment_id' => $payment_id ) ) : esc_html__( 'Sample Donation Form Title', 'give' ),
710
					'form_title'        => $payment_id ? give_email_tag_form_title( array( 'payment_id' => $payment_id ) ) : esc_html__( 'Sample Donation Form Title - Sample Donation Level', 'give' ),
711
					'sitename'          => $payment_id ? give_email_tag_sitename( array( 'payment_id' => $payment_id ) ) : get_bloginfo( 'name' ),
712
					'pdf_receipt'       => '<a href="#">Download Receipt</a>',
713
					'billing_address'   => $payment_id ? give_email_tag_billing_address( array( 'payment_id' => $payment_id ) ) : '',
714
					'email_access_link' => sprintf(
715
						'<a href="%1$s">%2$s</a>',
716
						add_query_arg(
717
							array(
718
								'give_nl' => uniqid(),
719
							),
720
							get_permalink( give_get_option( 'history_page' ) )
721
						),
722
						__( 'Access Donation Details &raquo;', 'give' )
723
					),
724
				)
725
			);
726
727
			// Decode tags.
728
			foreach ( $this->config['preview_email_tags_values'] as $preview_tag => $value ) {
729
				if ( isset( $this->config['preview_email_tags_values'][ $preview_tag ] ) ) {
730
					$message = str_replace( "{{$preview_tag}}", $this->config['preview_email_tags_values'][ $preview_tag ], $message );
731
				}
732
			}
733
734
			return apply_filters( 'give_email_preview_template_tags', $message );
735
		}
736
737
		/**
738
		 * Setup email data
739
		 *
740
		 * @since 2.0
741
		 */
742
		public function setup_email_data() {
743
		}
744
	}
745
746
endif; // End class_exists check
747