DNExpert.com - domain name news & opinions!
Have domain industry news? Contact us!

Hello & welcome!

BuddyPress How To Customize Activation Email

I have a couple of sites now running with BuddyPress, so not a week goes by without me doing some sort of customization to make things run smoother.

A recent problem I ran into was the inflexibility of the Activation notification emails users are sent when they register a BuddyPress account on my sites.

Amongst other things that I noticed was the ugly email subject whereby BuddyPress puts your site title in square brackets [] before the message “Activate Your Account”. I really do not want to have the site title in the subject as the site title is already part of the From field in the email.

Here is how I resolved this issue. You will find that you can use the same approach to customize other email fields also.

I discovered that BuddyPress defines a filter for the notification email subject in buddypress\bp-core\bp-core-signup.php called bp_core_activation_signup_user_notification_subject

So, in order to customize my notification email subject I added the following to my theme’s functions.php file:


function fix_bp_activation_subject($subject) {
return __( "Activate Your Account", 'buddypress' );
}
add_filter('bp_core_activation_signup_user_notification_subject', 'fix_bp_activation_subject');

You can do the same for the “to” and “message” fields too as there is a filter defined for each in the same file.

9 comments

  1. Hi Rafael,

    Do you care to clarify your problem?

    BuddyPress is a plugin to WordPress so obviously if you as the admin write blog posts you can add photos and videos – regardless of buddypress.

    If you want each user to add photos/videos perhaps you can enable multiple blogs? If you don’t want to do that, you’d have to do a bit more customization to be able to enable your BuddyPress users to be authors on your original blog without giving any other powers.

    John

  2. Hi, as you are a user of buddypress, could you tell if a shared hosting is ok or a dedicated server is needed for buddypress?

    Thanks

  3. Hi Line,

    If you are just starting out, it really doesn’t matter. I would recommend you start out with shared hosting definitely and see how you go.

    Buddypress is a plugin of WordPress and as such uses caching etc which improves performance greatly.

    Obviously as your site grows, or if you already have a high traffic website where you want to use BuddyPress, you will benefit from better hosting.

    John

  4. Hi,
    I tried your code in my installation (WP3.3 + BP 1.5.2) but doesn’t change anything.
    My BP version doesn’t have buddypress/bp-core/bp-core-signup.php but the filter bp_core_activation_signup_user_notification_subject is in buddypress/bp-core/bp-core-filters.php

    Many thanks

  5. Thanks for the help in changing the subject text.
    It still works for WP 3.4.2 and BP 1.6
    Can you give me the code on how to add some content to the message?
    I’m trying to add an image and some html to the content and I cant seem to make it work.
    I know the format is somewhat like this:
    function fix_bp_activation_message($message) {

    }
    add_filter(‘bp_core_activation_signup_user_notification_message’, ‘fix_bp_activation_message’);
    What do I place in the content area?

  6. I cannot get the bp_core_activation_signup_user_notification_subject filter to work on WP 3.4.2 with BP 1.6.1 or WP 3.5.3 with BP 1.6.3. I can’t make changes to the email Subject.

  7. I have worked it out. The function seems to be in buddypress/bp-members/bp-members-functions.php for me and the filter for Subject is bp_core_signup_send_validation_email_subject.

Leave a Reply