total ) { $total += $log->total; } if ( $log->sent ) { $sent += $log->sent; } if ( $log->failed ) { $failed += $log->failed; } if ( $is_addonactivated && property_exists( $log, 'opened' ) ) { $opened += $log->opened; } } } /** * Filters the email address to which the report is sent. * * @param string $to The email address to which the report is sent. * @since 2.9.0 * @version 1.0.0 */ $admin_email = apply_filters( 'postman_rat_reporting_email_to', get_option( 'admin_email' ) ); $admin_name = ''; $user = get_user_by( 'email', $admin_email ); if ( $user ) { $admin_name = ! empty( $user->first_name ) ? $user->first_name : $user->user_login; } /** * Filters the site title to be used in the email subject. * * @param string $site_title The site title. * @since 2.9.0 * @version 1.0.0 */ $site_title = apply_filters( 'postman_rat_reporting_email_site_title', get_bloginfo( 'name' ) ); $url = admin_url( "admin.php?page=post-smtp-email-reporting&from={$from}&to={$to}" ); $extension_url = 'https://postmansmtp.com/pricing/?utm_source=wordpress&utm_medium=email&utm_campaign=email_report&utm_content=report_and_tracking'; $disable_url = 'https://postmansmtp.com/pricing/?utm_source=wordpress&utm_medium=email&utm_campaign=email_report&utm_content=email_health_report/'; $body = '
'; if(! post_smtp_has_pro()) { $body .= ''; } if(!empty($logs)) { $logs_html = ''; $logs_html .= ''; $row = 1; foreach ( $logs as $log ) { // Let break if greater than 3. if ( $row > 3 ) { break; } else { $logs_html .= ' '; } $row ++; } $logs_html .= ''; } if(empty($log)) { $logs_html = ''; $logs_html .= ''; } if($is_addonactivated && ! empty($logs)) { $body .= ''; } $body .='

Hi '.$admin_name.'

Here is a quick overview of how your emails were performing in the past '.$duration.'

'.($is_addonactivated ? ' ' : '' ).'
Total Emails
'.$total.'
Sent
'.$sent.'
Failed
'.$failed.'
'.($is_addonactivated ? '
Opened
'.$opened.'
' : '
Opened
').'
View More Stats

Unlock the Post SMTP Pro and enhance your email deliverability

  • check More Pro Mailers mailers.png
  • check All mobile app premium features.
  • check Auto-resend failed emails.
  • check SMS Failure Notification.
Learn more about PRO
email-fav.png
'.$log->subject.'
'.( isset( $log->total ) ? $log->total : '' ).' '.( isset( $log->sent ) ? $log->sent : '' ).' '.( isset( $log->failed ) ? $log->failed : '' ).' '.( isset( $log->opened ) ? $log->opened : '' ).'
No emails were sent last '.$duration.'

dashicons-clock Last '.$duration.' Top Emails

'.$logs_html.'
Subject Total Sent Failed Opened
This email was auto-generated and learn how to disable it
'; return $body; } } endif;