Last active
March 28, 2022 08:55
-
-
Save patrickposner/5e1de2c74896b935cf83587ec2bbfa24 to your computer and use it in GitHub Desktop.
Passster: Send e-mail once password was used.
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_validation_success_list', function( $password, $password_list_id, $post_id ) { | |
// 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 ' . get_the_title( $password_list_id ) . ' was used to unlock content on ' . get_permalink( $post_id ); | |
// Now we can send the e-mail. | |
wp_mail( $to, $subject, $body, $headers ); | |
}, 2, 10 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment