• Home
  • Cloud
    • General
    • SaaS
    • BPaaS
    • PaaS
    • IaaS
    • Other Internet Hosted Applications
      • WordPress
        • WooThemes Canvas
          • WooThemes Canvas CSS
  • About me
  • Why Badly Wired?
  • Contact

Badly Wired

WordPress Security, Plugins, Hosting, Performance, APIs

You are here: Home / Code snippets / Code snippet to change notification of new users

Code snippet to change notification of new users

5th February 2018 by Alan Leave a Comment

Example plugin to set admin notification of new users. In this case it uses the first user defined as shop_manager role

<?php
/*
 *
 * Plugin Name:       Notify New Users to Shop Manager
 * Plugin URI:        https://fullworks.net/products/custom-plugin-development/
 * Description:       Needs Woo Commerce of Course
 * Version:           1.0
 * Author:            Fullworks
 * Author URI:        http://fullworks.net/
 * License:           GPL-3.0+
 * License URI:       http://www.gnu.org/licenses/gpl-3.0.txt
 */


function admin_email_callback( $wp_new_user_notification_email,  $user,  $blogname ) {
    $shopmanager = get_users( array( 'role' => 'shop_manager' ) );
// set the to: the first shop manager email.
    $wp_new_user_notification_email['to'] = $shopmanager[0]->user_email;
    return $wp_new_user_notification_email;
}
add_filter( 'wp_new_user_notification_email_admin', 'admin_email_callback', 10, 3 );

Download this as a plugin from fullworks -> https://fullworks.net/wp-content/uploads/2018/02/set-shop-manager-new-user.zip

Filed Under: Code snippets, Uncategorised, Wordpress  

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Applications
  • Cloud
    • General
    • Google Cloud
    • IaaS
    • Other Internet Hosted Applications
      • Wordpress
        • WooThemes Canvas
        • WooThemes Canvas CSS
    • SaaS
  • Code snippets
  • Discounts
  • Genesis
  • Google Apps for Works
  • Linux
  • News
  • SEO
  • Server setup
  • Services
  • Tech Tips
  • Uncategorised
  • Useful Images
  • Useful Stuff
  • WordPress Plugins

Tags

background jobs beadcrumbs bind brandings Cache canvas Centos chrome css fail2ban Find firefox Flash fraud genesis gocardless godaddy Google google maps hackers internet explorer javascript KashFlow Linus linux Magento mapquest maps microsoft mysql news nohup php plugin plugins queens diamond jubilee replace SED SEO skype Varnish Virtualmin Webmin woothemes Wordpress

 

Affiliate and Privacy Notices

This site is free to use, but hopes to cover some costs through affiliate income, some products and links are affiliates and may earn the site advertising income.

Some affiliates use Cookies to track if you purchase from them, this allows them to apportion revenue to us you will need to refer to their specific privacy notices as to how you are tracked.

This site is a participant in the Amazon EU Associates Programme, an affiliate advertising programme designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.co.uk.

  • Privacy Policy

Copyright © 2019 · Badly Wired