Created
March 25, 2022 13:02
-
-
Save patrickposner/15c902ebf02d46f4b33ecfd0f7c75469 to your computer and use it in GitHub Desktop.
Passster: Send e-mail one day before password expires.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'passster_compare_expiration_date', function( $password, $difference, $password_list_id ) { | |
if ( $difference == 1 ) { | |
// prepare and send the e-mail. | |
$to = '[email protected]'; | |
$subject = 'Password ' . $password . 'was used'; | |
$headers = array( 'Content-Type: text/html; charset=UTF-8' ); | |
$body = 'Password ' . $password . ' form passwords list ' . $password_list_id . ' will expire tomorrow'; | |
// Now we can send the e-mail. | |
wp_mail( $to, $subject, $body, $headers ); | |
} | |
}, 3, 10 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment