get( 'general', self::SETTINGS_SLUG ); // If option was not already set, then plugin was updated from lower version. if ( ( $value === '' || $value === null ) && ( is_multisite() || ! wp_mail_smtp()->is_pro() ) ) { $value = true; } /** * Filters whether summary report email is disabled. * * @since 3.0.0 * * @param bool $is_disabled */ $value = apply_filters( 'wp_mail_smtp_reports_emails_summary_is_disabled', $value ); return (bool) $value; } /** * Get summary report email preview link. * * @since 3.0.0 * * @return string Preview link. */ public static function get_preview_link() { return add_query_arg( [ 'mode' => 'summary_report_email_preview' ], wp_mail_smtp()->get_admin()->get_admin_page_url() ); } /** * Send summary report email. * * @since 3.0.0 */ public function send() { if ( $this->is_disabled() ) { return; } $parsed_home_url = wp_parse_url( home_url() ); $site_domain = $parsed_home_url['host']; if ( is_multisite() && isset( $parsed_home_url['path'] ) ) { $site_domain .= $parsed_home_url['path']; } $subject = sprintf( /* translators: %s - site domain. */ esc_html__( 'Your Weekly WP Mail SMTP Summary for %s', 'wp-mail-smtp' ), $site_domain ); /** * Filters the summaries email subject. * * @since 3.0.0 * * @param string $subject Email subject. */ $subject = apply_filters( 'wp_mail_smtp_reports_emails_summary_send_subject', $subject ); /** * Filters the summaries recipient email address. * * @since 3.0.0 * * @param string $email Recipient email address. */ $to_email = apply_filters( 'wp_mail_smtp_reports_emails_summary_send_to', get_option( 'admin_email' ) ); add_filter( 'wp_mail_content_type', [ $this, 'set_html_content_type' ] ); wp_mail( $to_email, $subject, $this->get_content() ); remove_filter( 'wp_mail_content_type', [ $this, 'set_html_content_type' ] ); } /** * Get summary report email content. * * @since 3.0.0 * * @return string */ public function get_content() { $content = $this->get_header_html(); $content .= $this->get_main_html(); $content .= $this->get_footer_html(); return $content; } /** * Get summary report email header HTML. * * @since 3.0.0 * * @return string */ private function get_header_html() { ob_start(); ?> <?php esc_html_e( 'WP Mail SMTP Weekly Email Summary', 'wp-mail-smtp' ); ?>
<?php esc_attr_e( 'WP Mail SMTP Logo', 'wp-mail-smtp' ); ?>
'misc' ], wp_mail_smtp()->get_admin()->get_admin_page_url( Area::SLUG ) ); ob_start(); ?>
get_upgrade_link( [ 'medium' => 'weekly-email-summary', 'content' => 'upgrade-to-wp-mail-smtp-pro-button', ] ); ob_start(); ?>

get_stats_total_html( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped __( 'Total Emails', 'wp-mail-smtp' ), 'icon-email.png', $reports->get_total_emails_sent(), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped $reports->get_total_emails_sent() - $reports->get_total_weekly_emails_sent( 'previous' ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped '#809EB0' ); ?> get_stats_total_html( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped __( 'Last week', 'wp-mail-smtp' ), 'icon-check.png', $reports->get_total_weekly_emails_sent( 'now' ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped $reports->get_total_weekly_emails_sent( 'previous' ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped '#6AA08B' ); ?>
 
<?php esc_attr_e( 'Reports', 'wp-mail-smtp' ); ?>

WP Mail SMTP Pro and unlock Email Log and advanced Email Reports. Start measuring the success of your emails today!', 'wp-mail-smtp' ), [ 'b' => [], 'u' => [], ] ); ?>

get_stats_total_item_width(); $percent_change = $this->calc_percent_change( $value, $prev_value ); $images_dir_url = wp_mail_smtp()->assets_url . '/images/reports/email/'; $icon_width = ( $icon === 'icon-email.png' ) ? 34 : 32; ob_start(); ?>

<?php echo esc_attr( $title ); ?>

<?php echo esc_attr( $title ); ?> %

$diff >= 0, 'value' => round( $percent_change, 1 ), ]; } /** * Set the HTML content type. * * @since 3.0.0 * * @return string */ public function set_html_content_type() { return 'text/html'; } }