Making WordPress.org

Changeset 8272


Ignore:
Timestamp:
02/18/2019 11:50:00 PM (8 years ago)
Author:
iandunn
Message:

WordCamp Organizer Reminders: Log failed attempts to send.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-organizer-reminders/wcor-mailer.php

    r8271 r8272  
    11<?php
     2
     3use function WordCamp\Logger\log;
    24
    35/**
     
    112114        protected function mail( $to, $subject, $body, $headers = array(), $email, $wordcamp ) {
    113115                if ( ! $this->validate_email_addresses( $to ) ) {
     116                        log( 'Message not sent because of invalid recipients.', compact( 'email', 'wordcamp' ) );
    114117                        return false;
    115118                }
     
    130133                        foreach ( $to as $individual_recipient ) {
    131134                                if ( ! wp_mail( $individual_recipient, $subject, $body, $headers ) ) {
     135                                        log( 'Message failed to send', compact( 'individual_recipient', 'email', 'wordcamp' ) );
    132136                                        $status = false;
    133137                                }
     
    135139                } else {
    136140                        $status = wp_mail( $to, $subject, $body, $headers );
     141
     142                        if ( ! $status ) {
     143                                log( 'Message failed to send', compact( 'email', 'wordcamp' ) );
     144                        }
    137145                }
    138146
Note: See TracChangeset for help on using the changeset viewer.