cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PowerUser19
Helper III
Helper III

Send Profile picture of selected manager in email

Hi there, I need to send profile picture of Manager in the email. I have Html text with a table and list of fields. Is it possible to get the profile picture of the manager to the email content (like a thumbnail in the body of the email and NOT as an attachment) 

Any help is highly appreciated! 


Authorising Manager Email : " &"" & UpdateRequestDropdown.Selected.'Authorising Manager'.Email &"" & "
" & "
Authorising Manager Title : " &"" & UpdateRequestDropdown.Selected.'Authorising Manager'.JobTitle &"" & "
" & "
Authorising Manager Division : " &"" & UpdateRequestDropdown.Selected.'Authorising Manager'.Department &"" & "
" & "
Authorising Manager Image : " &"" & UpdateRequestDropdown.Selected.'Authorising Manager'.Picture &"" & "
" & "
Authorising Manager Image : " &"" & Office365Users.UserPhotoV2( UpdateRequestDropdown.Selected.'Authorising Manager'.Email) &"" & "
"

 

==================================================================

 

The above code send the link for the image as below in the email:

Authorising Manager information:

Authorising Manager Name : XXXX XXXXX

Authorising Manager Email :XXXXX@t.com

Authorising Manager Title : Manager

Authorising Manager Division : Product Planning & Development

Authorising Manager Image : https://xxxxx/_layouts/15/UserPhoto.aspx?Size=L&AccountName=xxx.com

Authorising Manager Image : appres://blobmanager/d5be6112350a46f48d1724eddbb763f6/8

Authorising Manager Phone : +00000

Authorising Manager Pic : appres://blobmanager/d5be6112350a46f48d1724eddbb763f6/9

16 REPLIES 16

That's a really good workaround and thanks for let me know that everything works from your side!

 

and maybe you don't need the image field, have you tried this?

"<img src=" &JSON( Office365Users.UserPhotoV2(UpdateRequestDropdown.Selected.'Authorising Manager'.Email).Image,IncludeBinaryData)&"width='50'"&"height='50'"& ">"

PowerUser19
Helper III
Helper III

@victorcp If I do that, I am getting the attached error

victorcp
Solution Sage
Solution Sage

hmm... that's right, you are using it in a text or html text, right? I created my code in the 'onselect' of a button (a behaviour property) and the conversion to a json works there

 

victorcp_0-1663142638186.pngvictorcp_1-1663142674047.png

 

Hi, @victorcp ...
Nice to know you..
I am using that code, But got this result on my email:

Azalia20_0-1674554998863.png

What should I do?

Can you share your code? looks like there are extra cotas in it

Azalia20
Frequent Visitor

Set(
varImage,
JSON(
Office365Users.UserProfileV2(User().Email),
IncludeBinaryData
)
);
Office365Outlook.SendEmailV2(
User().Email,
"Test",
"<p>My Photo: <img src='" & varImage & "'style='height:20px; width: 20px'</p>"
)

Here it is...

victorcp
Solution Sage
Solution Sage

The problem is varImage is not an image. Change the 'Office365Users.UserProfileV2' to 'Office365Users.UserPhotoV2' and let me know if it works

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,309)