| @@ -236,9 +236,8 @@ | ||
| 236 | 236 | * |
| 237 | 237 | * @since 2.03.04 |
| 238 | 238 | * |
| 239 | 239 | * @param array $user_id_args |
| 240 | - * | |
| 241 | 240 | * @return void |
| 242 | 241 | */ |
| 243 | 242 | private function set_from( $user_id_args ) { |
| 244 | 243 | if ( empty( $this->settings['from'] ) ) { |
| @@ -281,15 +280,11 @@ | ||
| 281 | 280 | * |
| 282 | 281 | * @return void |
| 283 | 282 | */ |
| 284 | 283 | private function set_is_plain_text() { |
| 285 | - if ( empty( $this->settings['email_style'] ) ) { | |
| 286 | - // If `email_style` isn't set, use the `plain_text` checkbox. | |
| 287 | - $this->is_plain_text = ! empty( $this->settings['plain_text'] ); | |
| 288 | - return; | |
| 284 | + if ( $this->settings['plain_text'] ) { | |
| 285 | + $this->is_plain_text = true; | |
| 289 | 286 | } |
| 290 | - | |
| 291 | - $this->is_plain_text = 'plain' === $this->settings['email_style']; | |
| 292 | 287 | } |
| 293 | 288 | |
| 294 | 289 | /** |
| 295 | 290 | * Set the include_user_info property |
| @@ -402,13 +397,12 @@ | ||
| 402 | 397 | $pass_entry = clone $this->entry; |
| 403 | 398 | $mail_body = FrmEntriesHelper::replace_default_message( |
| 404 | 399 | $prev_mail_body, |
| 405 | 400 | array( |
| 406 | - 'id' => $this->entry->id, | |
| 407 | - 'entry' => $pass_entry, | |
| 408 | - 'plain_text' => $this->is_plain_text, | |
| 409 | - 'user_info' => $this->include_user_info, | |
| 410 | - 'table_style' => $this->settings['email_style'], | |
| 401 | + 'id' => $this->entry->id, | |
| 402 | + 'entry' => $pass_entry, | |
| 403 | + 'plain_text' => $this->is_plain_text, | |
| 404 | + 'user_info' => $this->include_user_info, | |
| 411 | 405 | ) |
| 412 | 406 | ); |
| 413 | 407 | |
| 414 | 408 | // Add the user info if it isn't already included |
| @@ -421,8 +415,10 @@ | ||
| 421 | 415 | } |
| 422 | 416 | |
| 423 | 417 | $this->message = $mail_body; |
| 424 | 418 | |
| 419 | + $this->message = do_shortcode( $this->message ); | |
| 420 | + | |
| 425 | 421 | if ( $this->is_plain_text ) { |
| 426 | 422 | $this->message = wp_specialchars_decode( strip_tags( $this->message ), ENT_QUOTES ); |
| 427 | 423 | $this->message = str_replace( ' ', '', $this->message ); |
| 428 | 424 | } else { |
| @@ -438,10 +434,9 @@ | ||
| 438 | 434 | * @return void |
| 439 | 435 | */ |
| 440 | 436 | private function add_autop() { |
| 441 | 437 | $message = $this->message; |
| 442 | - preg_match( '/<body[^>]*>([\s\S]*?)<\/body>/', $message, $match ); | |
| 443 | - | |
| 438 | + $result = preg_match( '/<body[^>]*>([\s\S]*?)<\/body>/', $message, $match ); | |
| 444 | 439 | if ( ! empty( $match[1] ) ) { |
| 445 | 440 | $this->message = str_replace( $match[1], trim( wpautop( $match[1] ) ), $message ); |
| 446 | 441 | } else { |
| 447 | 442 | $this->message = trim( wpautop( $message ) ); |
| @@ -534,9 +529,8 @@ | ||
| 534 | 529 | $this->remove_buddypress_filters(); |
| 535 | 530 | $this->add_mandrill_filter(); |
| 536 | 531 | |
| 537 | 532 | $sent = false; |
| 538 | - | |
| 539 | 533 | if ( count( $this->to ) > 1 && $this->is_single_recipient ) { |
| 540 | 534 | foreach ( $this->to as $recipient ) { |
| 541 | 535 | $sent = $this->send_single( $recipient ); |
| 542 | 536 | } |
| @@ -575,9 +569,8 @@ | ||
| 575 | 569 | if ( ! $sent ) { |
| 576 | 570 | if ( is_array( $header ) ) { |
| 577 | 571 | $header = implode( "\r\n", $header ); |
| 578 | 572 | } |
| 579 | - | |
| 580 | 573 | $recipient = implode( ',', (array) $recipient ); |
| 581 | 574 | $sent = mail( $recipient, $subject, $this->message, $header ); |
| 582 | 575 | } |
| 583 | 576 | |
| @@ -626,9 +619,8 @@ | ||
| 626 | 619 | 'field_key' => '', |
| 627 | 620 | ); |
| 628 | 621 | |
| 629 | 622 | $user_id_args['field_id'] = FrmEmailHelper::get_user_id_field_for_form( $form_id ); |
| 630 | - | |
| 631 | 623 | if ( $user_id_args['field_id'] ) { |
| 632 | 624 | $user_id_args['field_key'] = FrmField::get_key_by_id( $user_id_args['field_id'] ); |
| 633 | 625 | } |
| 634 | 626 | |
| @@ -672,9 +664,8 @@ | ||
| 672 | 664 | * @return array|string $emails |
| 673 | 665 | */ |
| 674 | 666 | private function explode_emails( $emails ) { |
| 675 | 667 | $emails = ( ! empty( $emails ) ? preg_split( '/(,|;)/', $emails ) : '' ); |
| 676 | - | |
| 677 | 668 | if ( is_array( $emails ) ) { |
| 678 | 669 | $emails = array_map( 'trim', $emails ); |
| 679 | 670 | } else { |
| 680 | 671 | $emails = trim( $emails ); |
| @@ -743,9 +734,8 @@ | ||
| 743 | 734 | if ( strpos( $from_email, '@yahoo.com' ) ) { |
| 744 | 735 | |
| 745 | 736 | // Get the site domain and get rid of www. |
| 746 | 737 | $sitename = strtolower( FrmAppHelper::get_server_value( 'SERVER_NAME' ) ); |
| 747 | - | |
| 748 | 738 | if ( substr( $sitename, 0, 4 ) === 'www.' ) { |
| 749 | 739 | $sitename = substr( $sitename, 4 ); |
| 750 | 740 | } |
| 751 | 741 | |
| @@ -785,9 +775,8 @@ | ||
| 785 | 775 | * @return string |
| 786 | 776 | */ |
| 787 | 777 | private function get_email_from_name( $name ) { |
| 788 | 778 | $email = trim( trim( $name, '>' ), '<' ); |
| 789 | - | |
| 790 | 779 | if ( strpos( $email, '<' ) !== false ) { |
| 791 | 780 | $parts = explode( '<', $email ); |
| 792 | 781 | $email = trim( $parts[1], '>' ); |
| 793 | 782 | } |
| @@ -823,10 +812,8 @@ | ||
| 823 | 812 | * @since 3.0.06 |
| 824 | 813 | * |
| 825 | 814 | * @param string $name |
| 826 | 815 | * @param string $email |
| 827 | - * | |
| 828 | - * @return string | |
| 829 | 816 | */ |
| 830 | 817 | private function format_from_email( $name, $email ) { |
| 831 | 818 | if ( '' !== $name ) { |
| 832 | 819 | $email = $name . ' <' . $email . '>'; |
| @@ -891,12 +878,10 @@ | ||
| 891 | 878 | 'subject' => $this->subject, |
| 892 | 879 | 'message' => $this->message, |
| 893 | 880 | 'attachments' => $this->attachments, |
| 894 | 881 | 'plain_text' => $this->is_plain_text, |
| 895 | - 'email_key' => $this->email_key, | |
| 896 | 882 | 'form' => $this->form, |
| 897 | 883 | 'entry' => $this->entry, |
| 898 | - 'email_style' => $this->settings['email_style'], | |
| 899 | 884 | ); |
| 900 | 885 | } |
| 901 | 886 | |
| 902 | 887 | /** |