Home › Forums › Front End PM PRO › Custom Email Tag
Tagged: Email Tag
- This topic has 5 replies, 2 voices, and was last updated 5 years ago by Shamim Hasan.
- AuthorPosts
- December 15, 2020 at 1:44 am #42049scott.kraftParticipant
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: https://sp-test1.arogga.co/docs/front-end-pm-pro/customization-front-end-pm-pro/add-own-email-tag/
But I do not see how to do this with a field from the user profile.
December 15, 2020 at 10:37 am #42053Shamim HasanKeymasterThere
$mgs->mgs_authoris the user id. So you can use this to get any value for that user.December 16, 2020 at 10:19 pm #42063scott.kraftParticipantCan 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?
December 17, 2020 at 10:10 pm #42070Shamim HasanKeymaster1. Which user filed you want to send? sender or receiver?
2. Which field you want to send?December 17, 2020 at 10:24 pm #42072scott.kraftParticipantWithin 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 URLI 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.
December 18, 2020 at 11:46 pm #42075Shamim HasanKeymasterI 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); - AuthorPosts
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.