Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[Membership - 2] - Disable the registration email on Subscriptions with the Manual gateway
<?php
/**
* Plugin Name: M2P Disable Email On Manual Account Creation
* Description: M2P Disable Email On Manual Account Creation
* Author: Thobk @ WPMUDEV
* Author URI: https://premium.wpmudev.org/profile/tho2757
* License: GPLv2 or later
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
add_action( 'plugins_loaded', 'wpmudev_ms_load_disable_email_func', 100 );
function wpmudev_ms_load_disable_email_func(){
if( defined('MS_IS_PRO') && MS_IS_PRO ){
function wpmudev_ms_disable_all_email_on_manual_account( $member, $subscription, $comm ){
if( 'admin' === $subscription->gateway_id ){
$comm->enabled = false;
}
}
add_action( 'ms_model_communication_send_message_before', 'wpmudev_ms_disable_all_email_on_manual_account', 10, 3 );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.