Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/28/2009 01:02:12 AM (15 years ago)
Author:
apeatling
Message:

Fixes #1102

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-activation.php

    r1905 r1970  
    7878 * Since the user now chooses their password, sending it over clear-text to an
    7979 * email address is no longer necessary. It's also a terrible idea security wise.
     80 *
     81 * This will only disable the email if a custom registration template is being used.
    8082 */
    8183function bp_core_disable_welcome_email() {
     84    if ( '' == locate_template( array( 'registration/register.php' ), false ) && '' == locate_template( array( 'register.php' ), false ) )
     85        return true;
     86   
    8287    return false;
    8388}
    8489add_filter( 'wpmu_welcome_user_notification', 'bp_core_disable_welcome_email' );
    8590
     91/***
     92 * bp_core_filter_activation_email()
     93 *
     94 * Filter the activation email to remove the line stating that another email will be sent
     95 * with the generated login details. This is not the case due to bp_core_disable_welcome_email()
     96 */
     97function bp_core_filter_activation_email( $email ) {
     98    if ( '' == locate_template( array( 'registration/register.php' ), false ) && '' == locate_template( array( 'register.php' ), false ) )
     99        return $email;
     100
     101    return str_replace( __( 'After you activate, you will receive *another email* with your login.', 'buddypress' ), '', $email );
     102}
     103add_filter( 'wpmu_signup_user_notification_email', 'bp_core_filter_activation_email' );
     104add_filter( 'wpmu_signup_blog_notification_email', 'bp_core_filter_activation_email' );
     105
    86106?>
Note: See TracChangeset for help on using the changeset viewer.