• Resolved tracykistler

    (@tracykistler)


    We are using this plugin and it’s working great, however we would prefer not to send automated replies to users from the plugin. Is there a way to turn this off?

    I would like to continue receiving notifications for admins, but I would like to provide more info in the email if possible. Are there more shortcodes that can be used? Username is not always helpful, I would prefer at least First and Last Name.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Michael Beckwith

    (@tw2113)

    The BenchPresser

    At least for removing the “Pending moderation” email that users get, I believe you should be able to remove that with the following code in your theme’s functions.php or similar.

    remove_action( 'bp_core_activated_user', 'bp_registration_options_notify_pending_user', 10, 3 );
    

    Regarding getting a display name in place, you could do something like this:

    function bpro_support_add_display_name( $message, $login, $email ) {
    	$user = get_user_by( 'email', $email );
    	$name = bp_core_get_user_displayname( $user->ID );
    
    	return str_replace( '[display_name]', $name, $message );
    }
    add_filter( 'bprwg_new_member_request_admin_email_message', , 10, 3 );
    

    This would add your own custom shortcode that you could filter out and replace with. You would then need to add [display_name] inside the saved message setting so that it can be properly placed where you want it in the wording.

    Thread Starter tracykistler

    (@tracykistler)

    Great, thanks for the custom shortcode code!

    I’m not so worried about the pending moderation email, it’s mostly the Membership Denied email. I would prefer to send that myself (not auto). At the very least I need to change the subject line.

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    If you’re just needing, at minimum, to change the denied subject line, we could use this filter:

    
    $subject         = __( 'Membership Denied', 'bp-registration-options' );
    ...
    $mailme = [
    	'user_email'   => $user->data->user_email,
    	'user_subject' => $subject,
    	'user_message' => $message,
    ];
    
    /**
     * Filters the email arguments before mailing.
     *
     * @since 4.2.0
     *
     * @param array  $emailme Array of email arguments for wp_mail.
     * @param object $user User object for user being moderated.
     */
    $mailme_filtered = apply_filters( 'bpro_hook_before_email', $mailme, $user );
    

    I can type up a quick function like i did earlier if needed.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘User Notifications and Shortcodes’ is closed to new replies.