PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 5.5
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v5.5
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 +128 -189 6.355.5 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,27 @@
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 - $this->message = $this->settings['email_message'];
364 + $this->message = FrmFieldsHelper::basic_replace_shortcodes( $this->settings['email_message'], $this->form, $this->entry );
390 365
391 - if ( ! $this->is_plain_text ) {
392 - // The decode is to support [default-html] shortcodes.
393 - $this->message = html_entity_decode( $this->message );
394 - }
395 -
396 - $this->message = FrmFieldsHelper::basic_replace_shortcodes( $this->message, $this->form, $this->entry );
397 366 $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(
367 + $pass_entry = clone $this->entry; // make a copy to prevent changes by reference
368 + $mail_body = FrmEntriesHelper::replace_default_message(
402 369 $prev_mail_body,
403 370 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'],
371 + 'id' => $this->entry->id,
372 + 'entry' => $pass_entry,
373 + 'plain_text' => $this->is_plain_text,
374 + 'user_info' => $this->include_user_info,
409 375 )
410 376 );
411 377
412 378 // Add the user info if it isn't already included
413 379 if ( $this->include_user_info && $prev_mail_body === $mail_body ) {
414 - $data = $this->entry->description;
380 + $data = $this->entry->description;
415 381 $mail_body .= "\r\n\r\n" . __( 'User Information', 'formidable' ) . "\r\n";
416 382 $this->maybe_add_ip( $mail_body );
417 383 $mail_body .= __( 'User-Agent (Browser/OS)', 'formidable' ) . ': ' . FrmEntriesHelper::get_browser( $data['browser'] ) . "\r\n";
418 384 $mail_body .= __( 'Referrer', 'formidable' ) . ': ' . $data['referrer'] . "\r\n";
@@ -419,39 +385,17 @@
419 385 }
420 386
421 387 $this->message = $mail_body;
422 388
389 + $this->message = do_shortcode( $this->message );
390 +
423 391 if ( $this->is_plain_text ) {
424 392 $this->message = wp_specialchars_decode( strip_tags( $this->message ), ENT_QUOTES );
425 - $this->message = str_replace( ' ', '', $this->message );
426 - } else {
427 - $this->add_autop();
428 393 }
429 394
430 395 $this->message = apply_filters( 'frm_email_message', $this->message, $this->package_atts() );
431 396 }
432 397
433 - /**
434 - * Runs message through autop, extracting the content inside body tag if it has <body>.
435 - *
436 - * @return void
437 - */
438 - private function add_autop() {
439 - $message = $this->message;
440 - preg_match( '/<body[^>]*>([\s\S]*?)<\/body>/', $message, $match );
441 -
442 - if ( ! empty( $match[1] ) ) {
443 - $this->message = str_replace( $match[1], trim( wpautop( $match[1] ) ), $message );
444 - } else {
445 - $this->message = trim( wpautop( $message ) );
446 - }
447 - }
448 -
449 - /**
450 - * @param string $mail_body
451 - *
452 - * @return void
453 - */
454 398 private function maybe_add_ip( &$mail_body ) {
455 399 if ( ! empty( $this->entry->ip ) ) {
456 400 $mail_body .= __( 'IP Address', 'formidable' ) . ': ' . $this->entry->ip . "\r\n";
457 401 }
@@ -484,24 +428,28 @@
484 428 * @return bool|mixed|void
485 429 */
486 430 public function should_send() {
487 431 if ( ! $this->has_recipients() ) {
488 - return false;
432 + $send = false;
433 + } else {
434 +
435 + $filter_args = array(
436 + 'message' => $this->message,
437 + 'subject' => $this->subject,
438 + 'recipient' => $this->to,
439 + 'header' => $this->package_header(),
440 + );
441 +
442 + /**
443 + * Stop an email based on the message, subject, recipient,
444 + * or any information included in the email header
445 + *
446 + * @since 2.2.8
447 + */
448 + $send = apply_filters( 'frm_send_email', true, $filter_args );
489 449 }
490 450
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 );
451 + return $send;
504 452 }
505 453
506 454 /**
507 455 * Check if an email has any recipients
@@ -510,9 +458,13 @@
510 458 *
511 459 * @return bool
512 460 */
513 461 private function has_recipients() {
514 - return $this->to || $this->cc || $this->bcc;
462 + if ( empty( $this->to ) && empty( $this->cc ) && empty( $this->bcc ) ) {
463 + return false;
464 + } else {
465 + return true;
466 + }
515 467 }
516 468
517 469 /**
518 470 * Send an email
@@ -525,9 +477,8 @@
525 477 $this->remove_buddypress_filters();
526 478 $this->add_mandrill_filter();
527 479
528 480 $sent = false;
529 -
530 481 if ( count( $this->to ) > 1 && $this->is_single_recipient ) {
531 482 foreach ( $this->to as $recipient ) {
532 483 $sent = $this->send_single( $recipient );
533 484 }
@@ -559,15 +510,15 @@
559 510 )
560 511 );
561 512
562 513 $subject = $this->encode_subject( $this->subject );
563 - $sent = wp_mail( $recipient, $subject, $this->message, $header, $this->attachments );
564 514
515 + $sent = wp_mail( $recipient, $subject, $this->message, $header, $this->attachments );
516 +
565 517 if ( ! $sent ) {
566 518 if ( is_array( $header ) ) {
567 519 $header = implode( "\r\n", $header );
568 520 }
569 -
570 521 $recipient = implode( ',', (array) $recipient );
571 522 $sent = mail( $recipient, $subject, $this->message, $header );
572 523 }
573 524
@@ -585,13 +536,13 @@
585 536 */
586 537 private function package_header() {
587 538 $header = array();
588 539
589 - if ( $this->cc ) {
540 + if ( ! empty( $this->cc ) ) {
590 541 $header[] = 'CC: ' . implode( ',', $this->cc );
591 542 }
592 543
593 - if ( $this->bcc ) {
544 + if ( ! empty( $this->bcc ) ) {
594 545 $header[] = 'BCC: ' . implode( ',', $this->bcc );
595 546 }
596 547
597 548 $header[] = 'From: ' . $this->from;
@@ -605,9 +556,9 @@
605 556 * Get the userID field ID and key for email settings
606 557 *
607 558 * @since 2.03.04
608 559 *
609 - * @param int $form_id
560 + * @param $form_id
610 561 *
611 562 * @return array
612 563 */
613 564 private function get_user_id_args( $form_id ) {
@@ -616,9 +567,8 @@
616 567 'field_key' => '',
617 568 );
618 569
619 570 $user_id_args['field_id'] = FrmEmailHelper::get_user_id_field_for_form( $form_id );
620 -
621 571 if ( $user_id_args['field_id'] ) {
622 572 $user_id_args['field_key'] = FrmField::get_key_by_id( $user_id_args['field_id'] );
623 573 }
624 574
@@ -630,16 +580,16 @@
630 580 *
631 581 * @since 2.03.04
632 582 *
633 583 * @param string $value
634 - * @param array $user_id_args
584 + * @param array $user_id_args
635 585 *
636 586 * @return string
637 587 */
638 588 private function prepare_email_setting( $value, $user_id_args ) {
639 - if ( str_contains( $value, '[' . $user_id_args['field_id'] . ']' ) ) {
589 + if ( strpos( $value, '[' . $user_id_args['field_id'] . ']' ) !== false ) {
640 590 $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'] . ']' ) ) {
591 + } elseif ( strpos( $value, '[' . $user_id_args['field_key'] . ']' ) !== false ) {
642 592 $value = str_replace( '[' . $user_id_args['field_key'] . ']', '[' . $user_id_args['field_key'] . ' show="user_email"]', $value );
643 593 }
644 594
645 595 $value = FrmFieldsHelper::basic_replace_shortcodes( $value, $this->form, $this->entry );
@@ -645,10 +595,11 @@
645 595 $value = FrmFieldsHelper::basic_replace_shortcodes( $value, $this->form, $this->entry );
646 596
647 597 // Remove brackets and add a space in case there isn't one
648 598 $value = str_replace( '<', ' ', $value );
599 + $value = str_replace( array( '"', '>' ), '', $value );
649 600
650 - return str_replace( array( '"', '>' ), '', $value );
601 + return $value;
651 602 }
652 603
653 604 /**
654 605 * Extract the emails from cc and bcc. Allow separation by , or ;.
@@ -657,13 +608,19 @@
657 608 * @since 2.03.04
658 609 *
659 610 * @param string $emails
660 611 *
661 - * @return array|string Emails.
612 + * @return array|string $emails
662 613 */
663 614 private function explode_emails( $emails ) {
664 - $emails = $emails ? preg_split( '/(,|;)/', $emails ) : '';
665 - return is_array( $emails ) ? array_map( 'trim', $emails ) : trim( $emails );
615 + $emails = ( ! empty( $emails ) ? preg_split( '/(,|;)/', $emails ) : '' );
616 + if ( is_array( $emails ) ) {
617 + $emails = array_map( 'trim', $emails );
618 + } else {
619 + $emails = trim( $emails );
620 + }
621 +
622 + return $emails;
666 623 }
667 624
668 625 /**
669 626 * Format the recipients( to, cc, bcc)
@@ -672,9 +629,9 @@
672 629 *
673 630 * @return array
674 631 */
675 632 private function format_recipients( $recipients ) {
676 - if ( ! $recipients ) {
633 + if ( empty( $recipients ) ) {
677 634 return $recipients;
678 635 }
679 636
680 637 foreach ( $recipients as $key => $val ) {
@@ -682,24 +639,24 @@
682 639
683 640 if ( is_email( $val ) ) {
684 641 // If a plain email is used, no formatting is needed
685 642 continue;
686 - }
643 + } else {
644 + $parts = explode( ' ', $val );
645 + $email = end( $parts );
687 646
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;
647 + if ( is_email( $email ) ) {
648 + // If user enters a name and email
649 + $name = trim( str_replace( $email, '', $val ) );
650 + } else {
651 + // If user enters a name without an email
652 + unset( $recipients[ $key ] );
653 + continue;
654 + }
695 655 }
696 656
697 - // If user enters a name and email
698 - $name = trim( str_replace( $email, '', $val ) );
699 -
700 657 $recipients[ $key ] = $this->format_from_email( $name, $email );
701 - }//end foreach
658 + }
702 659
703 660 return $recipients;
704 661 }
705 662
@@ -720,14 +677,14 @@
720 677 } else {
721 678 list( $from_name, $from_email ) = $this->get_name_and_email_for_sender( $from );
722 679 }
723 680
724 - // If sending the email from a yahoo address, change it to the WordPress default
725 - if ( str_contains( $from_email, '@yahoo.com' ) ) {
681 + // if sending the email from a yahoo address, change it to the WordPress default
682 + if ( strpos( $from_email, '@yahoo.com' ) ) {
683 +
726 684 // Get the site domain and get rid of www.
727 685 $sitename = strtolower( FrmAppHelper::get_server_value( 'SERVER_NAME' ) );
728 -
729 - if ( str_starts_with( $sitename, 'www.' ) ) {
686 + if ( substr( $sitename, 0, 4 ) === 'www.' ) {
730 687 $sitename = substr( $sitename, 4 );
731 688 }
732 689
733 690 $from_email = 'wordpress@' . $sitename;
@@ -749,9 +706,9 @@
749 706 $reply_to = trim( $reply_to );
750 707
751 708 if ( ! is_email( $reply_to ) ) {
752 709 list( $name, $email ) = $this->get_name_and_email_for_sender( $reply_to );
753 - $reply_to = $this->format_from_email( $name, $email );
710 + $reply_to = $this->format_from_email( $name, $email );
754 711 }
755 712
756 713 return $reply_to;
757 714 }
@@ -759,17 +716,12 @@
759 716 /**
760 717 * Get only the email if the name and email have been combined
761 718 *
762 719 * @since 3.0.06
763 - *
764 - * @param string $name
765 - *
766 - * @return string
767 720 */
768 721 private function get_email_from_name( $name ) {
769 722 $email = trim( trim( $name, '>' ), '<' );
770 -
771 - if ( str_contains( $email, '<' ) ) {
723 + if ( strpos( $email, '<' ) !== false ) {
772 724 $parts = explode( '<', $email );
773 725 $email = trim( $parts[1], '>' );
774 726 }
775 727
@@ -801,16 +753,15 @@
801 753 }
802 754
803 755 /**
804 756 * @since 3.0.06
805 - *
806 - * @param string $name
807 - * @param string $email
808 - *
809 - * @return string
810 757 */
811 758 private function format_from_email( $name, $email ) {
812 - return '' !== $name ? $name . ' <' . $email . '>' : $email;
759 + if ( '' !== $name ) {
760 + $email = $name . ' <' . $email . '>';
761 + }
762 +
763 + return $email;
813 764 }
814 765
815 766 /**
816 767 * Remove phone numbers from To addresses
@@ -816,42 +767,38 @@
816 767 * Remove phone numbers from To addresses
817 768 * Send the phone numbers to the frm_send_to_not_email hook
818 769 *
819 770 * @since 2.03.04
820 - *
821 - * @return void
822 771 */
823 772 private function handle_phone_numbers() {
773 +
824 774 foreach ( $this->to as $key => $recipient ) {
825 - if ( '[admin_email]' === $recipient || is_email( $recipient ) ) {
826 - continue;
827 - }
775 + if ( '[admin_email]' !== $recipient && ! is_email( $recipient ) ) {
776 + $recipient = explode( ' ', $recipient );
828 777
829 - $recipient = explode( ' ', $recipient );
778 + if ( is_email( end( $recipient ) ) ) {
779 + continue;
780 + }
830 781
831 - if ( is_email( end( $recipient ) ) ) {
832 - continue;
782 + do_action(
783 + 'frm_send_to_not_email',
784 + array(
785 + 'e' => $recipient,
786 + 'subject' => $this->subject,
787 + 'mail_body' => $this->message,
788 + 'reply_to' => $this->reply_to,
789 + 'from' => $this->from,
790 + 'plain_text' => $this->is_plain_text,
791 + 'attachments' => $this->attachments,
792 + 'form' => $this->form,
793 + 'email_key' => $key,
794 + )
795 + );
796 +
797 + // Remove phone number from to addresses
798 + unset( $this->to[ $key ] );
833 799 }
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
800 + }
854 801 }
855 802
856 803 /**
857 804 * Package an array of FrmEmail properties
@@ -870,12 +817,10 @@
870 817 'subject' => $this->subject,
871 818 'message' => $this->message,
872 819 'attachments' => $this->attachments,
873 820 'plain_text' => $this->is_plain_text,
874 - 'email_key' => $this->email_key,
875 821 'form' => $this->form,
876 822 'entry' => $this->entry,
877 - 'email_style' => $this->settings['email_style'],
878 823 );
879 824 }
880 825
881 826 /**
@@ -881,10 +826,8 @@
881 826 /**
882 827 * Remove the Buddypress email filters
883 828 *
884 829 * @since 2.03.04
885 - *
886 - * @return void
887 830 */
888 831 private function remove_buddypress_filters() {
889 832 remove_filter( 'wp_mail_from', 'bp_core_email_from_address_filter' );
890 833 remove_filter( 'wp_mail_from_name', 'bp_core_email_from_name_filter' );
@@ -894,10 +837,8 @@
894 837 * Add Mandrill line break filter
895 838 * Remove line breaks in HTML emails to prevent conflicts with Mandrill
896 839 *
897 840 * @since 2.03.04
898 - *
899 - * @return void
900 841 */
901 842 private function add_mandrill_filter() {
902 843 if ( ! $this->is_plain_text ) {
903 844 add_filter( 'mandrill_nl2br', 'FrmEmailHelper::remove_mandrill_br' );
@@ -907,10 +848,8 @@
907 848 /**
908 849 * Remove Mandrill line break filter
909 850 *
910 851 * @since 2.03.04
911 - *
912 - * @return void
913 852 */
914 853 private function remove_mandrill_filter() {
915 854 remove_filter( 'mandrill_nl2br', 'FrmEmailHelper::remove_mandrill_br' );
916 855 }
@@ -923,9 +862,9 @@
923 862 * @return string
924 863 */
925 864 private function encode_subject( $subject ) {
926 865 if ( apply_filters( 'frm_encode_subject', false, $subject ) ) {
927 - return '=?' . $this->charset . '?B?' . base64_encode( $subject ) . '?=';
866 + $subject = '=?' . $this->charset . '?B?' . base64_encode( $subject ) . '?=';
928 867 }
929 868
930 869 return $subject;
931 870 }