Send email notification when user role changes – Adding this snippet to the functions.php
of your WordPress theme will send the member an email notification when the user’s role has changed.
function user_role_update( $user_id, $new_role ) {
$site_url = get_bloginfo('wpurl');
$user_info = get_userdata( $user_id );
$to = $user_info->user_email;
$subject = "Role changed: ".$site_url."";
$message = "Hello " .$user_info->display_name . " your role has changed on ".$site_url.", congratulations you are now an " . $new_role;
wp_mail($to, $subject, $message);
}
add_action( 'set_user_role', 'user_role_update', 10, 2);
Related Posts:
- Send a confirmation of user role upgrade conditionally
- Allow users to register as a higher role than default with code
- Is there a way to embed an iframe in an email with text that updates?
- Sending multipart (text/html) emails via wp_mail() will likely get your domain banned
- Disable user registration password email
- “Reply-to Address” Email
- How to change the email notification recipient (user) for new comments?
- Disable new user notification to admin email
- How to disable automated E-Mail on PHP error/exception?
- Email stats at Ma.tt contact form
- Dynamically send pdf attached to post with contact form 7 [closed]
- wp_mail recipient array not sending?
- Transferring contact form input to an email account without using an email-proxy
- Should I use the standard wp_mail() function for a premium theme?
- How to Configure SMTP on wordpress Cant Send Email
- Contact Form 7 + Configure SMTP: Sender email appearing as my own email [closed]
- apostrophe in email name
- Disable WP notifications for commenting on own posts
- Must I change the admin user email address while changing the general email address?
- User invite email not delivered – related to subdomain?
- Can I configure WordPress to use postfix without a plugin?
- Ability to download only after email supplied [closed]
- Batch Emails with wp_mail()
- Obfuscating Email Addresses in Form Fields
- Email ‘from address’ has a www in it
- How to Change WooCommerce new order email?
- Is there no way to send email using SMTP without plugin or custom coding?
- PHP mail() works but wp_mail() does not
- Send email daily from WordPress site
- Mechanism to send to users of secured WordPress install new notifications by SMS or email?
- How to change the Customer new account email
- Is it possible to change an existing post status from ‘pending’ to ‘publish’ via email?
- WP mail sent to MS Exchange recipients = occasional email corruption?
- How to set custom from email address in wp
- How to send mail from WordPress if one server hosts page and another email?
- How to translate WordPress Emails?
- Disable email confirmation new register bbPress [closed]
- Script or plugin to send activation email automatically again after 2 hours
- Emails not getting delivered to Hotmail addresses
- How to receive an email with WordPress?
- Does the WordPress core software handle bounces on system email?
- how to email username and password to admin of new registration
- Generate email on meta value update
- Send email when publish new post in certain categories
- show a little contact form in homepage without plugin
- Automatically email daily archive
- Content of post does not end up in “ShareThis” mail
- reply via email link under each post
- WordPress email could not be sent
- How to differentiate between email subscription list and blog subscription list?
- Is there a way to follow a WordPress site by email alerts for new posts? [closed]
- How to stop WordPress from sending mails?
- Resend password chosen by WP administrator? [duplicate]
- Auto Log In Users after registration and send confirmation email
- Changing old email to new email, lost the password
- Using PHP mail; getting Header warning
- Images in wp_mail not showing
- Emailing system monitoring with WP
- WordPress site member verification emails going to spam on Outlook
- Mailing issues with wordpress?
- I want to setup a button/popup/whatever that will prompt users on the site to input their email address
- Sending a password reset link
- Receive no any emails from contact from 7 wordpress
- User Without Email?
- WordPress new user email formatting issues
- Email sent from WordPress has HTML tags
- email saying that was not possible to send the email
- WordPress emails are not delivered if the recipient email address has a non-traditional domain extension
- could not call wp_email function twice
- Is it possible to use different from email in contact form 7 with different domain?
- Email post to submitter
- How can I remove the product short description from the WooCommerce Mails?
- Adding user using admin ajax by a user with custom role
- Email verification at a later date?
- How to integerate WordPress Mail SMTP plugin to Report and Request custom page
- Contact Form 7 How to Alter the From email address?
- Custom Welcome Email | WordPress
- Emails sent from local wp webserver are beeing rejected from Siren?
- Check if “Send the new user an email about their account” is ticked
- email explanation for newbies
- WP Mail isn’t sending user account messages, does send from plugins
- WordPress stops executing code after the require() method
- User Registration – no Email required
- Email Piping using google apps within WP Engine
- Can we validate user email changes?
- Download Free Trial After Email Entered
- Email notification
- Custom notification for contributors when posts are scheduled
- Is there a way to get the site_url in HTML code?
- User profile update author
- Allowing Loading/Downloading of .mp3
- Contact Form 7 – E-mail message template [closed]
- Welcome Mails based on user role
- What is the correct way to send multipart email in wordpress?
- Woo-Commerce Send mail by code. [closed]
- Welcome Email Going to Spam
- What’s the simplest way to send WordPress posts to a Mailchimp list? [closed]
- Fighting Spam – What can I do as an: Email Administrator, Domain Owner, or User?
- How to add verification on email address change?
- Is there a wordpress function restrict public email id for registration like as is_email()