How to edit the registration email sent by buddypr

2019-09-02 19:41发布

问题:

I have this message when users register on my site, this is an excerpt of what is sent to the user and the email header message was incomplete. Take a look at what is sent when a user register

Email Subject = "[WWW Sites] Activate \http://1/"

And the email body message reads as below

"Thanks for registering! To complete the activation of your account and blog, please click the following link:

http://www.com/activate/?key=8b9c059db8ae9a5b

After you activate, you can visit your blog here:

\http://1/

So it is this incomplete messages that I would want to edit.

Thanks for your anticipated response

回答1:

You have go through the filter method used in Wordpress Because you can not changed the email text or subject directly from the file because the email are comming from Buddypress core file so you can use the filter method.

Please put below code in your theme functions.php file.

1.) Change the subject for Activation email put below code:

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

2.) Change the email body for Activation email put below code:

function change_activation_email_body($message) {
        return __( "Change Activate Email body", 'buddypress' );
    }
    add_filter('bp_core_activation_signup_user_notification_subject', 'change_activation_email_body');