Custom Email Tag

Home Forums Front End PM PRO Custom Email Tag

This topic is: Not Resolved


Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #42049

    Is there a way to add a new “Email Tag” that is a User Field that has been added to the User’s Profile?

    I saw the post:

    But I do not see how to do this with a field from the user profile.


    There $mgs->mgs_author is the user id. So you can use this to get any value for that user.


    Can you please give me an example of the exact syntax I would use to add a user field in “New message content” area under the Emails tab so I can include information from the Users profile in the email?


    1. Which user filed you want to send? sender or receiver?
    2. Which field you want to send?


    Within the New Message Content you already have the ability to insert the following:

    {{subject}} = Subject
    {{message}} = Full Message
    {{message_url}} = URL of message
    {{sender}} = Sender Name
    {{receiver}} = Receiver Name
    {{site_title}} = Website title
    {{site_url}} = Website URL

    I would like to insert in the same manner a special user profile field I created with “Ultimate Member” plugin called “One click Login”. I can see this field in the member profile area where I also see “First Name”, “Last Name”, “Nickname”, “Email”, “Website”, etc. My goal is to send a link that will automatically login the user so they can see their inbox. I am not giving users access to their account or password, they can only see their messages by using the One Click login link I have for them.


    I do not know how (or what meta) you used to store that value, So i cannot give you full code.
    You can use following code in your theme’s (child theme’s if you are using) functions.php (change necessary code to get that link from user profile)

    add_filter( 'fep_eb_email_legends', function( $legends, $mgs, $user_email ){
        $link = '';
        if( $user_email && ($user = get_user_by( 'email', $user_email ) ) ){
            $link = 'Here get that link from $user profile';
        $legends['one_click_login'] = array(
            'description' => __('One click Login link', 'front-end-pm'),
            'where' => array( 'newmessage', 'reply' ), //where this tag will be used
            'replace_with' => $link
        return $legends;
    }, 10, 3);
Viewing 6 posts - 1 through 6 (of 6 total)

You need to purchase ‘Front End PM PRO’ to create topic in this support forum.

If you already purchased ‘Front End PM PRO’ please LOGIN.