| @@ -2,8 +2,9 @@ | ||
| 2 | 2 | /** |
| 3 | 3 | * Summary email base class |
| 4 | 4 | * |
| 5 | 5 | * @since 6.7 |
| 6 | + * | |
| 6 | 7 | * @package Formidable |
| 7 | 8 | */ |
| 8 | 9 | |
| 9 | 10 | if ( ! defined( 'ABSPATH' ) ) { |
| @@ -92,8 +93,9 @@ | ||
| 92 | 93 | * @return false|string |
| 93 | 94 | */ |
| 94 | 95 | protected function get_content() { |
| 95 | 96 | $args = $this->get_content_args(); |
| 97 | + | |
| 96 | 98 | if ( false === $args ) { |
| 97 | 99 | return false; |
| 98 | 100 | } |
| 99 | 101 | |
| @@ -100,11 +102,9 @@ | ||
| 100 | 102 | ob_start(); |
| 101 | 103 | include $this->get_include_file( $this->template ); |
| 102 | 104 | $content = ob_get_clean(); |
| 103 | 105 | |
| 104 | - $content = str_replace( '%%INNER_CONTENT%%', $this->get_inner_content(), $content ); | |
| 105 | - | |
| 106 | - return $content; | |
| 106 | + return str_replace( '%%INNER_CONTENT%%', $this->get_inner_content(), $content ); | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
| 110 | 110 | * Gets include file path from the given file name. |
| @@ -109,8 +109,9 @@ | ||
| 109 | 109 | /** |
| 110 | 110 | * Gets include file path from the given file name. |
| 111 | 111 | * |
| 112 | 112 | * @param string $file_name File name. |
| 113 | + * | |
| 113 | 114 | * @return string |
| 114 | 115 | */ |
| 115 | 116 | protected function get_include_file( $file_name ) { |
| 116 | 117 | $suffix = $this->is_html ? '' : '-plain'; |
| @@ -176,8 +177,9 @@ | ||
| 176 | 177 | return false; |
| 177 | 178 | } |
| 178 | 179 | |
| 179 | 180 | $recipients = $this->get_recipients(); |
| 181 | + | |
| 180 | 182 | if ( ! $recipients ) { |
| 181 | 183 | // Return true to not try to send this email on the next day. |
| 182 | 184 | return true; |
| 183 | 185 | } |
| @@ -182,15 +184,17 @@ | ||
| 182 | 184 | return true; |
| 183 | 185 | } |
| 184 | 186 | |
| 185 | 187 | $content = $this->get_content(); |
| 188 | + | |
| 186 | 189 | if ( false === $content ) { |
| 187 | 190 | return true; |
| 188 | 191 | } |
| 192 | + | |
| 189 | 193 | $subject = $this->get_subject(); |
| 190 | 194 | $headers = $this->get_headers(); |
| 195 | + $sent = wp_mail( $recipients, $subject, $content, $headers ); | |
| 191 | 196 | |
| 192 | - $sent = wp_mail( $recipients, $subject, $content, $headers ); | |
| 193 | 197 | if ( ! $sent ) { |
| 194 | 198 | $headers = implode( "\r\n", $headers ); |
| 195 | 199 | $sent = mail( $recipients, $subject, $content, $headers ); |
| 196 | 200 | } |