• Resolved kurtlorenz

    (@kurtlorenz)


    Hey,
    I noticed the function sendEmailAboutNewSubscriptionToAdmin in alertme\inc\front-end\alertme-ajaxrequest.php is broken because you’re using the variable “$email” in line 167 without declaring it before:

    wp_mail( $email, $subject, nl2br($confirmation_email_body), $headers );

    You should declare the $email variable like:

    
    $email = get_option( 'admin_email' );
    wp_mail( $email, $subject, nl2br($confirmation_email_body), $headers ); 
    

    However many admins – like me – do not want to receive these notifications. Please add an option (or at least a filter) to deactivate the notification e-mail like:

    
    $email = apply_filters( 'alertme_send_subscribe_notification_to_admin', get_option( 'admin_email' ) );
    if( ! empty($email) ) wp_mail( $email, $subject, nl2br($confirmation_email_body), $headers ); 
    

    If the filter returns false no e-mail will be send and in addition the user can use the filter to alter the recipient.

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Admin Notification E-Mail broken and filter/option required’ is closed to new replies.