Home › Forums › Front End PM PRO › Adding Avatar image to Email
- This topic has 10 replies, 3 voices, and was last updated 6 years, 5 months ago by c-alle.
- AuthorPosts
- February 28, 2019 at 11:48 pm #22124Jon HarariParticipant
Hi,
How can we include the Sender’s avatar image to the email notification that is sent to the recipient? I see there are several fields like {{subject}}, {{message}}, {{message_url}}, etc. but can we also add avatar image?
Thanks,
JonMarch 5, 2019 at 6:00 pm #22215Shamim HasanKeymasterYou can add your own tag. Please follow https://sp-test1.arogga.co/docs/front-end-pm-pro/customization-front-end-pm-pro/add-own-email-tag/
July 9, 2019 at 10:09 pm #26719c-alleParticipantI would like to add the profile image of the sender and receiver in the e-mail notification, what code should I use?
Thanks.July 10, 2019 at 5:29 pm #26768Shamim HasanKeymasterYou can follow above link.
Do you use any plugin for profile image? Do you know how to get profile image url form user id?July 10, 2019 at 5:32 pm #26770c-alleParticipantHi, thanks for the reply. I use Ultimate Member.
July 11, 2019 at 12:37 am #26774Shamim HasanKeymasterYou can show them above link so that they can modify that as you need.
Or
Ask them how to get profile image url from user id and let me know so that i can modify that code as you need.July 11, 2019 at 1:01 am #26776c-alleParticipantThanks, I tried to ask how to get the url of the profile picture. I await their response.
July 11, 2019 at 3:38 am #26787c-alleParticipant
$user_IDER = get_current_user_id (); (Here you recover ID, in this case current user)
um_fetch_user ($user_IDER); (Here you set profile IDs for which you want to obtain the url of the avatar)
$avatar_uri = um_get_avatar_uri (um_profile ('profile_photo'), 32); (Here you get avatars of that ID)
echo $avatar_uri; (Here you can see the url of the avatar)
Can this help you?
thanks.
July 11, 2019 at 3:53 am #26790c-alleParticipantOtherwise with this code you can see the avatar directly.
$user_IDER = get_current_user_id (); (Here you recover ID, in this case current user)
um_fetch_user ($user_IDER); (Here you set profile IDs for which you want to get the avatar)
echo get_avatar( um_user('ID'), 32 );
July 11, 2019 at 1:32 pm #26798Shamim HasanKeymasteradd following code in your theme’s (child theme’s if using) functions.php
add_filter( 'fep_eb_email_legends', function( $legends, $mgs, $user_email ){ $legends['cus_sender_avatar'] = array( 'description' => __('Sender Avatar', 'front-end-pm'), 'where' => array( 'newmessage', 'reply' ), //where this tag will be used 'replace_with' => $mgs ? get_avatar( $mgs->mgs_author, 64 ) : '', ); $legends['cus_receiver_avatar'] = array( 'description' => __('Receiver Avatar', 'front-end-pm'), 'where' => array( 'newmessage', 'reply' ), //where this tag will be used 'replace_with' => $mgs ? get_avatar( $user_email, 64 ) : '', ); return $legends; }, 10, 3);Then you can use
{{cus_sender_avatar}}and{{cus_receiver_avatar}}July 11, 2019 at 2:25 pm #26800c-alleParticipantPerfect, thank you very much. ????
- 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.