functions – Trigger email alert if file downloaded
Question
I’ve found this solution which triggers an email alert when an article is viewed, but wondered if a similar technique is possible for when a specific file is downloaded?
function article_email_alert() {
global $post;
if( $post->ID == 1234) {
wp_mail( 'sam@example.net', 'Alert', 'The article was visited.' );
}
}
add_action( 'wp', 'article_email_alert' );
0
11 months
2022-03-17T13:06:06-05:00
2022-03-17T13:06:06-05:00 0 Answers
0 views
0
Leave an answer