PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.0
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.0
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/models/FrmEmail.php +131 -171 6.356.0 View file →
@@ -8,94 +8,94 @@
8 8 */
9 9 class FrmEmail {
10 10
11 11 /**
12 - * @var string
12 + * @var string $email_key
13 13 */
14 14 private $email_key = '';
15 15
16 16 /**
17 - * @var array
17 + * @var array $to
18 18 */
19 19 private $to = array();
20 20
21 21 /**
22 - * @var array
22 + * @var array $cc
23 23 */
24 24 private $cc = array();
25 25
26 26 /**
27 - * @var array
27 + * @var array $bcc
28 28 */
29 29 private $bcc = array();
30 30
31 31 /**
32 - * @var string
32 + * @var string $from
33 33 */
34 34 private $from = '';
35 35
36 36 /**
37 - * @var string
37 + * @var string $reply_to
38 38 */
39 39 private $reply_to = '';
40 40
41 41 /**
42 - * @var string
42 + * @var string $subject
43 43 */
44 44 private $subject = '';
45 45
46 46 /**
47 - * @var string
47 + * @var string $message
48 48 */
49 49 private $message = '';
50 50
51 51 /**
52 - * @var array
52 + * @var array $attachments
53 53 */
54 54 private $attachments = array();
55 55
56 56 /**
57 - * @var bool
57 + * @var bool $is_plain_text
58 58 */
59 59 private $is_plain_text = false;
60 60
61 61 /**
62 - * @var bool
62 + * @var bool $is_single_recipient
63 63 */
64 64 private $is_single_recipient = false;
65 65
66 66 /**
67 - * @var bool
67 + * @var bool $include_user_info
68 68 */
69 69 private $include_user_info = false;
70 70
71 71 /**
72 - * @var string
72 + * @var string $charset
73 73 */
74 74 private $charset = '';
75 75
76 76 /**
77 - * @var string
77 + * @var string $content_type
78 78 */
79 79 private $content_type = 'text/html';
80 80
81 81 /**
82 - * @var array
82 + * @var array $settings
83 83 */
84 84 private $settings = array();
85 85
86 86 /**
87 - * @var stdClass
87 + * @var stdClass $entry
88 88 */
89 89 private $entry;
90 90
91 91 /**
92 - * @var stdClass
92 + * @var stdClass $form
93 93 */
94 94 private $form;
95 95
96 96 /**
97 - * @var int
97 + * @var int $action_id
98 98 */
99 99 private $action_id = 0;
100 100
101 101 /**
@@ -141,10 +141,8 @@
141 141 *
142 142 * @since 2.03.04
143 143 *
144 144 * @param object $action
145 - *
146 - * @return void
147 145 */
148 146 private function set_email_key( $action ) {
149 147 $this->email_key = $action->ID;
150 148 }
@@ -154,10 +152,8 @@
154 152 *
155 153 * @since 2.03.04
156 154 *
157 155 * @param array $user_id_args
158 - *
159 - * @return void
160 156 */
161 157 private function set_to( $user_id_args ) {
162 158 $to = $this->prepare_email_setting( $this->settings['email_to'], $user_id_args );
163 159 $to = $this->explode_emails( $to );
@@ -175,9 +171,9 @@
175 171 $to = apply_filters( 'frm_to_email', $to, $values, $this->form->id, $args );
176 172
177 173 $this->to = array_unique( (array) $to );
178 174
179 - if ( ! $this->to ) {
175 + if ( empty( $this->to ) ) {
180 176 return;
181 177 }
182 178
183 179 $this->handle_phone_numbers();
@@ -190,10 +186,8 @@
190 186 *
191 187 * @since 2.03.04
192 188 *
193 189 * @param array $user_id_args
194 - *
195 - * @return void
196 190 */
197 191 private function set_cc( $user_id_args ) {
198 192 $this->cc = $this->prepare_additional_recipients( $this->settings['cc'], $user_id_args );
199 193 }
@@ -203,10 +197,8 @@
203 197 *
204 198 * @since 2.03.04
205 199 *
206 200 * @param array $user_id_args
207 - *
208 - * @return void
209 201 */
210 202 private function set_bcc( $user_id_args ) {
211 203 $this->bcc = $this->prepare_additional_recipients( $this->settings['bcc'], $user_id_args );
212 204 }
@@ -216,9 +208,9 @@
216 208 *
217 209 * @since 2.03.04
218 210 *
219 211 * @param string $recipients
220 - * @param array $user_id_args
212 + * @param array $user_id_args
221 213 *
222 214 * @return array
223 215 */
224 216 private function prepare_additional_recipients( $recipients, $user_id_args ) {
@@ -223,11 +215,13 @@
223 215 */
224 216 private function prepare_additional_recipients( $recipients, $user_id_args ) {
225 217 $recipients = $this->prepare_email_setting( $recipients, $user_id_args );
226 218 $recipients = $this->explode_emails( $recipients );
219 +
227 220 $recipients = array_unique( (array) $recipients );
221 + $recipients = $this->format_recipients( $recipients );
228 222
229 - return $this->format_recipients( $recipients );
223 + return $recipients;
230 224 }
231 225
232 226 /**
233 227 * Set the From addresses
@@ -234,14 +228,13 @@
234 228 *
235 229 * @since 2.03.04
236 230 *
237 231 * @param array $user_id_args
238 - *
239 232 * @return void
240 233 */
241 234 private function set_from( $user_id_args ) {
242 235 if ( empty( $this->settings['from'] ) ) {
243 - $from = FrmEmailHelper::get_default_from_email();
236 + $from = get_option( 'admin_email' );
244 237 } else {
245 238 $from = $this->prepare_email_setting( $this->settings['from'], $user_id_args );
246 239 }
247 240
@@ -253,10 +246,8 @@
253 246 *
254 247 * @since 2.03.04
255 248 *
256 249 * @param array $user_id_args
257 - *
258 - * @return void
259 250 */
260 251 private function set_reply_to( $user_id_args ) {
261 252 $this->reply_to = trim( $this->settings['reply_to'] );
262 253
@@ -275,19 +266,13 @@
275 266 * Set the is_plain_text property
276 267 * This should be set before the message
277 268 *
278 269 * @since 2.03.04
279 - *
280 - * @return void
281 270 */
282 271 private function set_is_plain_text() {
283 - if ( empty( $this->settings['email_style'] ) ) {
284 - // If `email_style` isn't set, use the `plain_text` checkbox.
285 - $this->is_plain_text = ! empty( $this->settings['plain_text'] );
286 - return;
272 + if ( $this->settings['plain_text'] ) {
273 + $this->is_plain_text = true;
287 274 }
288 -
289 - $this->is_plain_text = 'plain' === $this->settings['email_style'];
290 275 }
291 276
292 277 /**
293 278 * Set the include_user_info property
@@ -293,10 +278,8 @@
293 278 * Set the include_user_info property
294 279 * This should be set before the message
295 280 *
296 281 * @since 2.03.04
297 - *
298 - * @return void
299 282 */
300 283 private function set_include_user_info() {
301 284 if ( isset( $this->settings['inc_user_info'] ) ) {
302 285 $this->include_user_info = $this->settings['inc_user_info'];
@@ -307,11 +290,9 @@
307 290 * Set the is_single_recipient property
308 291 *
309 292 * @since 2.03.04
310 293 *
311 - * @param object $action
312 - *
313 - * @return void
294 + * @param $action
314 295 */
315 296 private function set_is_single_recipient( $action ) {
316 297 $args = array(
317 298 'form' => $this->form,
@@ -330,10 +311,8 @@
330 311 /**
331 312 * Set the charset
332 313 *
333 314 * @since 2.03.04
334 - *
335 - * @return void
336 315 */
337 316 private function set_charset() {
338 317 $this->charset = get_option( 'blog_charset' );
339 318 }
@@ -341,10 +320,8 @@
341 320 /**
342 321 * Set the content type
343 322 *
344 323 * @since 2.03.04
345 - *
346 - * @return void
347 324 */
348 325 private function set_content_type() {
349 326 if ( $this->is_plain_text ) {
350 327 $this->content_type = 'text/plain';
@@ -381,38 +358,33 @@
381 358 /**
382 359 * Set the email message
383 360 *
384 361 * @since 2.03.04
385 - *
386 - * @return void
387 362 */
388 363 private function set_message() {
389 364 $this->message = $this->settings['email_message'];
390 365
391 366 if ( ! $this->is_plain_text ) {
392 - // The decode is to support [default-html] shortcodes.
393 - $this->message = html_entity_decode( $this->message );
367 + $this->message = html_entity_decode( $this->message ); // The decode is to support [default-html] shortcodes.
394 368 }
395 369
396 - $this->message = FrmFieldsHelper::basic_replace_shortcodes( $this->message, $this->form, $this->entry );
370 + $this->message = FrmFieldsHelper::basic_replace_shortcodes( $this->message, $this->form, $this->entry );
371 +
397 372 $prev_mail_body = $this->message;
398 -
399 - // Make a copy to prevent changes by reference.
400 - $pass_entry = clone $this->entry;
401 - $mail_body = FrmEntriesHelper::replace_default_message(
373 + $pass_entry = clone $this->entry; // make a copy to prevent changes by reference
374 + $mail_body = FrmEntriesHelper::replace_default_message(
402 375 $prev_mail_body,
403 376 array(
404 - 'id' => $this->entry->id,
405 - 'entry' => $pass_entry,
406 - 'plain_text' => $this->is_plain_text,
407 - 'user_info' => $this->include_user_info,
408 - 'table_style' => $this->settings['email_style'],
377 + 'id' => $this->entry->id,
378 + 'entry' => $pass_entry,
379 + 'plain_text' => $this->is_plain_text,
380 + 'user_info' => $this->include_user_info,
409 381 )
410 382 );
411 383
412 384 // Add the user info if it isn't already included
413 385 if ( $this->include_user_info && $prev_mail_body === $mail_body ) {
414 - $data = $this->entry->description;
386 + $data = $this->entry->description;
415 387 $mail_body .= "\r\n\r\n" . __( 'User Information', 'formidable' ) . "\r\n";
416 388 $this->maybe_add_ip( $mail_body );
417 389 $mail_body .= __( 'User-Agent (Browser/OS)', 'formidable' ) . ': ' . FrmEntriesHelper::get_browser( $data['browser'] ) . "\r\n";
418 390 $mail_body .= __( 'Referrer', 'formidable' ) . ': ' . $data['referrer'] . "\r\n";
@@ -419,11 +391,12 @@
419 391 }
420 392
421 393 $this->message = $mail_body;
422 394
395 + $this->message = do_shortcode( $this->message );
396 +
423 397 if ( $this->is_plain_text ) {
424 398 $this->message = wp_specialchars_decode( strip_tags( $this->message ), ENT_QUOTES );
425 - $this->message = str_replace( ' ', '', $this->message );
426 399 } else {
427 400 $this->add_autop();
428 401 }
429 402
@@ -431,15 +404,12 @@
431 404 }
432 405
433 406 /**
434 407 * Runs message through autop, extracting the content inside body tag if it has <body>.
435 - *
436 - * @return void
437 408 */
438 409 private function add_autop() {
439 410 $message = $this->message;
440 - preg_match( '/<body[^>]*>([\s\S]*?)<\/body>/', $message, $match );
441 -
411 + $result = preg_match( '/<body[^>]*>([\s\S]*?)<\/body>/', $message, $match );
442 412 if ( ! empty( $match[1] ) ) {
443 413 $this->message = str_replace( $match[1], trim( wpautop( $match[1] ) ), $message );
444 414 } else {
445 415 $this->message = trim( wpautop( $message ) );
@@ -445,13 +415,8 @@
445 415 $this->message = trim( wpautop( $message ) );
446 416 }
447 417 }
448 418
449 - /**
450 - * @param string $mail_body
451 - *
452 - * @return void
453 - */
454 419 private function maybe_add_ip( &$mail_body ) {
455 420 if ( ! empty( $this->entry->ip ) ) {
456 421 $mail_body .= __( 'IP Address', 'formidable' ) . ': ' . $this->entry->ip . "\r\n";
457 422 }
@@ -484,24 +449,28 @@
484 449 * @return bool|mixed|void
485 450 */
486 451 public function should_send() {
487 452 if ( ! $this->has_recipients() ) {
488 - return false;
453 + $send = false;
454 + } else {
455 +
456 + $filter_args = array(
457 + 'message' => $this->message,
458 + 'subject' => $this->subject,
459 + 'recipient' => $this->to,
460 + 'header' => $this->package_header(),
461 + );
462 +
463 + /**
464 + * Stop an email based on the message, subject, recipient,
465 + * or any information included in the email header
466 + *
467 + * @since 2.2.8
468 + */
469 + $send = apply_filters( 'frm_send_email', true, $filter_args );
489 470 }
490 471
491 - $filter_args = array(
492 - 'message' => $this->message,
493 - 'subject' => $this->subject,
494 - 'recipient' => $this->to,
495 - 'header' => $this->package_header(),
496 - );
497 - /**
498 - * Stop an email based on the message, subject, recipient,
499 - * or any information included in the email header
500 - *
501 - * @since 2.2.8
502 - */
503 - return apply_filters( 'frm_send_email', true, $filter_args );
472 + return $send;
504 473 }
505 474
506 475 /**
507 476 * Check if an email has any recipients
@@ -510,9 +479,13 @@
510 479 *
511 480 * @return bool
512 481 */
513 482 private function has_recipients() {
514 - return $this->to || $this->cc || $this->bcc;
483 + if ( empty( $this->to ) && empty( $this->cc ) && empty( $this->bcc ) ) {
484 + return false;
485 + } else {
486 + return true;
487 + }
515 488 }
516 489
517 490 /**
518 491 * Send an email
@@ -525,9 +498,8 @@
525 498 $this->remove_buddypress_filters();
526 499 $this->add_mandrill_filter();
527 500
528 501 $sent = false;
529 -
530 502 if ( count( $this->to ) > 1 && $this->is_single_recipient ) {
531 503 foreach ( $this->to as $recipient ) {
532 504 $sent = $this->send_single( $recipient );
533 505 }
@@ -559,15 +531,15 @@
559 531 )
560 532 );
561 533
562 534 $subject = $this->encode_subject( $this->subject );
563 - $sent = wp_mail( $recipient, $subject, $this->message, $header, $this->attachments );
564 535
536 + $sent = wp_mail( $recipient, $subject, $this->message, $header, $this->attachments );
537 +
565 538 if ( ! $sent ) {
566 539 if ( is_array( $header ) ) {
567 540 $header = implode( "\r\n", $header );
568 541 }
569 -
570 542 $recipient = implode( ',', (array) $recipient );
571 543 $sent = mail( $recipient, $subject, $this->message, $header );
572 544 }
573 545
@@ -585,13 +557,13 @@
585 557 */
586 558 private function package_header() {
587 559 $header = array();
588 560
589 - if ( $this->cc ) {
561 + if ( ! empty( $this->cc ) ) {
590 562 $header[] = 'CC: ' . implode( ',', $this->cc );
591 563 }
592 564
593 - if ( $this->bcc ) {
565 + if ( ! empty( $this->bcc ) ) {
594 566 $header[] = 'BCC: ' . implode( ',', $this->bcc );
595 567 }
596 568
597 569 $header[] = 'From: ' . $this->from;
@@ -605,9 +577,9 @@
605 577 * Get the userID field ID and key for email settings
606 578 *
607 579 * @since 2.03.04
608 580 *
609 - * @param int $form_id
581 + * @param $form_id
610 582 *
611 583 * @return array
612 584 */
613 585 private function get_user_id_args( $form_id ) {
@@ -616,9 +588,8 @@
616 588 'field_key' => '',
617 589 );
618 590
619 591 $user_id_args['field_id'] = FrmEmailHelper::get_user_id_field_for_form( $form_id );
620 -
621 592 if ( $user_id_args['field_id'] ) {
622 593 $user_id_args['field_key'] = FrmField::get_key_by_id( $user_id_args['field_id'] );
623 594 }
624 595
@@ -630,16 +601,16 @@
630 601 *
631 602 * @since 2.03.04
632 603 *
633 604 * @param string $value
634 - * @param array $user_id_args
605 + * @param array $user_id_args
635 606 *
636 607 * @return string
637 608 */
638 609 private function prepare_email_setting( $value, $user_id_args ) {
639 - if ( str_contains( $value, '[' . $user_id_args['field_id'] . ']' ) ) {
610 + if ( strpos( $value, '[' . $user_id_args['field_id'] . ']' ) !== false ) {
640 611 $value = str_replace( '[' . $user_id_args['field_id'] . ']', '[' . $user_id_args['field_id'] . ' show="user_email"]', $value );
641 - } elseif ( str_contains( $value, '[' . $user_id_args['field_key'] . ']' ) ) {
612 + } elseif ( strpos( $value, '[' . $user_id_args['field_key'] . ']' ) !== false ) {
642 613 $value = str_replace( '[' . $user_id_args['field_key'] . ']', '[' . $user_id_args['field_key'] . ' show="user_email"]', $value );
643 614 }
644 615
645 616 $value = FrmFieldsHelper::basic_replace_shortcodes( $value, $this->form, $this->entry );
@@ -645,10 +616,11 @@
645 616 $value = FrmFieldsHelper::basic_replace_shortcodes( $value, $this->form, $this->entry );
646 617
647 618 // Remove brackets and add a space in case there isn't one
648 619 $value = str_replace( '<', ' ', $value );
620 + $value = str_replace( array( '"', '>' ), '', $value );
649 621
650 - return str_replace( array( '"', '>' ), '', $value );
622 + return $value;
651 623 }
652 624
653 625 /**
654 626 * Extract the emails from cc and bcc. Allow separation by , or ;.
@@ -657,13 +629,19 @@
657 629 * @since 2.03.04
658 630 *
659 631 * @param string $emails
660 632 *
661 - * @return array|string Emails.
633 + * @return array|string $emails
662 634 */
663 635 private function explode_emails( $emails ) {
664 - $emails = $emails ? preg_split( '/(,|;)/', $emails ) : '';
665 - return is_array( $emails ) ? array_map( 'trim', $emails ) : trim( $emails );
636 + $emails = ( ! empty( $emails ) ? preg_split( '/(,|;)/', $emails ) : '' );
637 + if ( is_array( $emails ) ) {
638 + $emails = array_map( 'trim', $emails );
639 + } else {
640 + $emails = trim( $emails );
641 + }
642 +
643 + return $emails;
666 644 }
667 645
668 646 /**
669 647 * Format the recipients( to, cc, bcc)
@@ -672,9 +650,9 @@
672 650 *
673 651 * @return array
674 652 */
675 653 private function format_recipients( $recipients ) {
676 - if ( ! $recipients ) {
654 + if ( empty( $recipients ) ) {
677 655 return $recipients;
678 656 }
679 657
680 658 foreach ( $recipients as $key => $val ) {
@@ -682,24 +660,24 @@
682 660
683 661 if ( is_email( $val ) ) {
684 662 // If a plain email is used, no formatting is needed
685 663 continue;
686 - }
664 + } else {
665 + $parts = explode( ' ', $val );
666 + $email = end( $parts );
687 667
688 - $parts = explode( ' ', $val );
689 - $email = end( $parts );
690 -
691 - if ( ! is_email( $email ) ) {
692 - // If user enters a name without an email
693 - unset( $recipients[ $key ] );
694 - continue;
668 + if ( is_email( $email ) ) {
669 + // If user enters a name and email
670 + $name = trim( str_replace( $email, '', $val ) );
671 + } else {
672 + // If user enters a name without an email
673 + unset( $recipients[ $key ] );
674 + continue;
675 + }
695 676 }
696 677
697 - // If user enters a name and email
698 - $name = trim( str_replace( $email, '', $val ) );
699 -
700 678 $recipients[ $key ] = $this->format_from_email( $name, $email );
701 - }//end foreach
679 + }
702 680
703 681 return $recipients;
704 682 }
705 683
@@ -720,14 +698,14 @@
720 698 } else {
721 699 list( $from_name, $from_email ) = $this->get_name_and_email_for_sender( $from );
722 700 }
723 701
724 - // If sending the email from a yahoo address, change it to the WordPress default
725 - if ( str_contains( $from_email, '@yahoo.com' ) ) {
702 + // if sending the email from a yahoo address, change it to the WordPress default
703 + if ( strpos( $from_email, '@yahoo.com' ) ) {
704 +
726 705 // Get the site domain and get rid of www.
727 706 $sitename = strtolower( FrmAppHelper::get_server_value( 'SERVER_NAME' ) );
728 -
729 - if ( str_starts_with( $sitename, 'www.' ) ) {
707 + if ( substr( $sitename, 0, 4 ) === 'www.' ) {
730 708 $sitename = substr( $sitename, 4 );
731 709 }
732 710
733 711 $from_email = 'wordpress@' . $sitename;
@@ -749,9 +727,9 @@
749 727 $reply_to = trim( $reply_to );
750 728
751 729 if ( ! is_email( $reply_to ) ) {
752 730 list( $name, $email ) = $this->get_name_and_email_for_sender( $reply_to );
753 - $reply_to = $this->format_from_email( $name, $email );
731 + $reply_to = $this->format_from_email( $name, $email );
754 732 }
755 733
756 734 return $reply_to;
757 735 }
@@ -759,17 +737,12 @@
759 737 /**
760 738 * Get only the email if the name and email have been combined
761 739 *
762 740 * @since 3.0.06
763 - *
764 - * @param string $name
765 - *
766 - * @return string
767 741 */
768 742 private function get_email_from_name( $name ) {
769 743 $email = trim( trim( $name, '>' ), '<' );
770 -
771 - if ( str_contains( $email, '<' ) ) {
744 + if ( strpos( $email, '<' ) !== false ) {
772 745 $parts = explode( '<', $email );
773 746 $email = trim( $parts[1], '>' );
774 747 }
775 748
@@ -801,16 +774,15 @@
801 774 }
802 775
803 776 /**
804 777 * @since 3.0.06
805 - *
806 - * @param string $name
807 - * @param string $email
808 - *
809 - * @return string
810 778 */
811 779 private function format_from_email( $name, $email ) {
812 - return '' !== $name ? $name . ' <' . $email . '>' : $email;
780 + if ( '' !== $name ) {
781 + $email = $name . ' <' . $email . '>';
782 + }
783 +
784 + return $email;
813 785 }
814 786
815 787 /**
816 788 * Remove phone numbers from To addresses
@@ -816,42 +788,38 @@
816 788 * Remove phone numbers from To addresses
817 789 * Send the phone numbers to the frm_send_to_not_email hook
818 790 *
819 791 * @since 2.03.04
820 - *
821 - * @return void
822 792 */
823 793 private function handle_phone_numbers() {
794 +
824 795 foreach ( $this->to as $key => $recipient ) {
825 - if ( '[admin_email]' === $recipient || is_email( $recipient ) ) {
826 - continue;
827 - }
796 + if ( '[admin_email]' !== $recipient && ! is_email( $recipient ) ) {
797 + $recipient = explode( ' ', $recipient );
828 798
829 - $recipient = explode( ' ', $recipient );
799 + if ( is_email( end( $recipient ) ) ) {
800 + continue;
801 + }
830 802
831 - if ( is_email( end( $recipient ) ) ) {
832 - continue;
803 + do_action(
804 + 'frm_send_to_not_email',
805 + array(
806 + 'e' => $recipient,
807 + 'subject' => $this->subject,
808 + 'mail_body' => $this->message,
809 + 'reply_to' => $this->reply_to,
810 + 'from' => $this->from,
811 + 'plain_text' => $this->is_plain_text,
812 + 'attachments' => $this->attachments,
813 + 'form' => $this->form,
814 + 'email_key' => $key,
815 + )
816 + );
817 +
818 + // Remove phone number from to addresses
819 + unset( $this->to[ $key ] );
833 820 }
834 -
835 - do_action(
836 - 'frm_send_to_not_email',
837 - array(
838 - 'e' => $recipient,
839 - 'subject' => $this->subject,
840 - 'mail_body' => $this->message,
841 - 'reply_to' => $this->reply_to,
842 - 'from' => $this->from,
843 - 'plain_text' => $this->is_plain_text,
844 - 'attachments' => $this->attachments,
845 - 'form' => $this->form,
846 - 'email_key' => $key,
847 - )
848 - );
849 -
850 - // Remove phone number from to addresses
851 - unset( $this->to[ $key ] );
852 - // end if
853 - }//end foreach
821 + }
854 822 }
855 823
856 824 /**
857 825 * Package an array of FrmEmail properties
@@ -870,12 +838,10 @@
870 838 'subject' => $this->subject,
871 839 'message' => $this->message,
872 840 'attachments' => $this->attachments,
873 841 'plain_text' => $this->is_plain_text,
874 - 'email_key' => $this->email_key,
875 842 'form' => $this->form,
876 843 'entry' => $this->entry,
877 - 'email_style' => $this->settings['email_style'],
878 844 );
879 845 }
880 846
881 847 /**
@@ -881,10 +847,8 @@
881 847 /**
882 848 * Remove the Buddypress email filters
883 849 *
884 850 * @since 2.03.04
885 - *
886 - * @return void
887 851 */
888 852 private function remove_buddypress_filters() {
889 853 remove_filter( 'wp_mail_from', 'bp_core_email_from_address_filter' );
890 854 remove_filter( 'wp_mail_from_name', 'bp_core_email_from_name_filter' );
@@ -894,10 +858,8 @@
894 858 * Add Mandrill line break filter
895 859 * Remove line breaks in HTML emails to prevent conflicts with Mandrill
896 860 *
897 861 * @since 2.03.04
898 - *
899 - * @return void
900 862 */
901 863 private function add_mandrill_filter() {
902 864 if ( ! $this->is_plain_text ) {
903 865 add_filter( 'mandrill_nl2br', 'FrmEmailHelper::remove_mandrill_br' );
@@ -907,10 +869,8 @@
907 869 /**
908 870 * Remove Mandrill line break filter
909 871 *
910 872 * @since 2.03.04
911 - *
912 - * @return void
913 873 */
914 874 private function remove_mandrill_filter() {
915 875 remove_filter( 'mandrill_nl2br', 'FrmEmailHelper::remove_mandrill_br' );
916 876 }
@@ -923,9 +883,9 @@
923 883 * @return string
924 884 */
925 885 private function encode_subject( $subject ) {
926 886 if ( apply_filters( 'frm_encode_subject', false, $subject ) ) {
927 - return '=?' . $this->charset . '?B?' . base64_encode( $subject ) . '?=';
887 + $subject = '=?' . $this->charset . '?B?' . base64_encode( $subject ) . '?=';
928 888 }
929 889
930 890 return $subject;
931 891 }