Forum breadcrumbs – You are here:Asgaros Support ForumSupportEmail Notification tags
Please or Register to create posts and topics.

Email Notification tags

I would like to change the default ###USERNAME### to be the users First Name. Can you please tell me what this would be? IF you have a link to a list of email tags, that would be great.

Thanks

Amanda

Hey @amandahaccpmentor-com,

by default, there are only the following replacements:

  • ###USERNAME###
  • ###AUTHOR###
  • ###LINK###
  • ###TITLE###
  • ###CONTENT###

If you want to use the first name you can try the following code:

add_filter('asgarosforum_user_replacements', 10, 2);

function add_firstname($replacements, $user){
    if($user){
        $replacements['###FIRSTNAME###'] = $user->user_firstname;
    } else {
        // Please Change 'User' to a default value for the case that there is no user found by this email
        $replacements['###FIRSTNAME###'] = 'User';
    }

    return $replacements;
}

After adding this code, you can use ###FIRSTNAME### in the template settings.

Asgaros has reacted to this post.
Asgaros
Need professional help with Asgaros Forum? Book an appointment with us at domra Web Solutions for setup and customization services. Learn more about our Toolbox for Asgaros Forum plugin to enhance your forum experience.