• Resolved hustlefish

    (@hustlefish)


    I have tried placing {password_reset_link} in the account welcome email. The {} tag is not replaced with the password reset link. It just returns as plain tex. The strange thing is that {password_reset_link} code works in the password reset email template. After reading several support questions I have made sure “Use HTML for E-mails?” is checked but this has not resolved the issue.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @hustlefish

    The default {password_reset_link} short tag only works in Password Reset email.

    You can try this code snippet below and see if the password reset URL will show up in the Welcome Email template. Use the short tag {password_reset_link_v2} in the template.

    /**
    * UM Placeholders for reset password
    *
    * @param $placeholders
    *
    * @return array
    */
    function um_121520_add_placeholder( $placeholders ) {
        $placeholders[] = '{password_reset_link_v2}';
        return $placeholders;
    }
    add_filter( 'um_template_tags_patterns_hook', 'um_121520_add_placeholder', 10, 1 );
    
    /**
    * UM Replace Placeholders for reset password
    *
    * @param $replace_placeholders
    *
    * @return array
    */
    function um_121520_add_replace_placeholder( $replace_placeholders ) {
        $replace_placeholders[] = UM()->password()->reset_url();
        return $replace_placeholders;
    }
    add_filter( 'um_template_tags_replaces_hook', 'um_121520_add_replace_placeholder', 10, 1 );
    

    Regards,

    Thread Starter hustlefish

    (@hustlefish)

    Thanks for the help! Looks like this is really close to working. It generates the link but then when I try to reset the password I get a security error “This is not possible for security reasons. This message was triggered by ultimate-member.” I don’t have any security plugin or server level WAF active. Looks like it’s a security check from Ultimate Member. Below is the Call Stack

    wp_die()
    wp-content/plugins/ultimate-member/includes/core/class-password.php:535
    um\c\Password->um_change_password_errors_hook()
    wp-includes/class-wp-hook.php:287
    do_action(‘um_change_password_errors_hook’)
    wp-content/plugins/ultimate-member/includes/core/class-password.php:409
    um\c\Password->form_init()
    wp-includes/class-wp-hook.php:287
    do_action(‘template_redirect’)
    wp-includes/template-loader.php:13

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @hustlefish

    Could you please confirm that this is the exact message thrown?

    “This is not possible for security reasons. This message was triggered by ultimate-member.”

    I tried searching in the plugin but this part is not generated by UM:
    This message was triggered by ultimate-member.

    Regards,

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @hustlefish

    ..Please feel free to re-open this thread by changing the Topic Status to ‘Not Resolved’ if any other questions come up and we’d be happy to help. ??

    Regards,

    Hello,

    In case that helps… I faced a similar problem. I followed your instructions and added your script. Like @hustlefish , link was then generated in email but when I tried to reset password and validate, I would also get the following error :

    “This is not possible for security reasons.”

    I then realized it was only because I was still logged with my admin user (so I couuld modify email template).

    Thanks for your script

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘{password_reset_link} not working in Account Welcome Email’ is closed to new replies.