BuddyDev

Search

Branded Login mail adjustment


  • Participant
    Level: Enlightened
    Posts: 29
    rabb on #26858

    I forgot one thing. You mentioned in post #26701 that you would provide a setting in the backend to adjust the subject and complete message of the mails. Can you include that feature also? Then I would not have to hack the source code.

    Regards

    Ralf


  • Keymaster
    (BuddyDev Team)
    Posts: 13268
    Brajesh Singh on #26867

    Hi Ralf,

    I do plan to add the mail settings in upcoming release. The current release was aimed at fixing translations and a few other minor things I had noted.

    You can use the translators(poedit or a plugin) to avoid hacking around the source code in the current release too.

    Thank you
    Brajesh


  • Participant
    Level: Enlightened
    Posts: 29
    rabb on #26932

    Hi Barjesh,

    okay, I’ll wait for the upcoming release for the new mail functionality.

    As mentioned in my post #26857 the current version is still not translating everything. Can you have a look at my post and tell me the right way to translate everything? Or is there still a bug?

    Regards

    Ralf


  • Keymaster
    (BuddyDev Team)
    Posts: 13268
    Brajesh Singh on #26938

    Hi Ralf,

    The message is translatable. Please see line 193 in core/classes/class-bl-actions-handler.php

    If you used the translation file that came with file, you will see it around msg id 4 and 20.

    Regards
    Brajesh


  • Participant
    Level: Enlightened
    Posts: 29
    rabb on #27140

    Hi Barjesh,

    that’s right, the message of the mail is translatable now.

    But I’m referring to the text messages of the notice field that are stored in the file ‘bp-branded-login-en_US.po’. Not all of them are translated when I generate a new po-file in another language.

    For example:
    1. Open the reset password url
    2. Insert a mail that does not exist.
    3. The notice ‘Invalid email!’ appears although this string is translated in the new po-file.

    I think the reason for that can be found for example in the file bl-functions.php, line 274:

    'invalid_email' => __( 'Invalid email!', 'bl_branded_login' ),

    This line refers to ‘bl_branded_login’ that does not exist. There are also many other positions, see my post #26857.

    In my opinion every occurrence of the string ‘bl-branded-login’ or ‘bl_branded_login’ should be replaced with ‘bl-branded-login’.

    What do you think?

    Regards

    Ralf


  • Keymaster
    (BuddyDev Team)
    Posts: 13268
    Brajesh Singh on #27145

    Hi Ralf,
    Thank you.

    You are right. That is the issue. I will post another plugin update in next 2-3 days.

    Thank you
    Brajesh


  • Participant
    Level: Enlightened
    Posts: 29
    rabb on #27298

    Hi Barjesh,

    do you have some news concerning the discussed issue and the bugfix?

    Best regards

    Ralf


  • Keymaster
    (BuddyDev Team)
    Posts: 13268
    Brajesh Singh on #27312

    Hi Ralf,
    I am sorry for the delayed reply. We will be pushing the update by this Tuesday. It is related to the translations only? or is there anything else that I am missing?

    Thank you
    Brajesh


  • Participant
    Level: Enlightened
    Posts: 29
    rabb on #27319

    Hi Barjesh,

    no worries, the site is still under development.
    I haven’t found any further bugs so far.
    But it would be nice if you could add a variable [first_name] in the e-mails.

    I mean for the class-bl-actions-handler.php:

    if ( ! bl_is_valid_key( $_GET['key'], $_GET['login'] ) ) {
    			$info_message['error'] = __( 'Either key is invalid or login name is invalid.', 'bl-branded-login' );
    		} else {
    			$user     = get_user_by( 'login', $_GET['login'] );
    			$password = wp_generate_password();
    			$first_name = $user->first_name;

    and

    $message = str_replace(
    				array(
    					'[user_login]',
    					'[password]',
    					'[login_url]',
    					'[first_name]',
    				),
    				array(
    					$user->user_login,
    					$password,
    					$link,
    					$first_name,
    				),
    				$message
    			);

    and for the bl-functions.php:

    // Redefining user_login ensures we return the right case in the email.
    	$user_login = $user_data->user_login;
    	$user_email = $user_data->user_email;
    	$key        = get_password_reset_key( $user_data );
    	$first_name = $user_data->first_name;

    and

    $message = str_replace(
    		array(
    			'[user_login]',
    			'[site_url]',
    			'[reset_url]',
    			'[first_name]',
    		),
    		array(
    			$user_login,
    			network_home_url( '/' ),
    			trailingslashit( wp_lostpassword_url() ) . "?action=verify&key=$key&login=" . rawurlencode( $user_login ),
    			$first_name,

    Best regards

    Ralf

You must be logged in to reply to this topic.

This topic is: not resolved
Subscribe