Skip to content

Instantly share code, notes, and snippets.

@patrickposner
Created March 25, 2022 13:02
Show Gist options
  • Save patrickposner/15c902ebf02d46f4b33ecfd0f7c75469 to your computer and use it in GitHub Desktop.
Save patrickposner/15c902ebf02d46f4b33ecfd0f7c75469 to your computer and use it in GitHub Desktop.
Passster: Send e-mail one day before password expires.
<?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