How to return Image from service broker method as return property

  • 31 May 2016
  • 1 reply
  • 4 views

Badge

Hi All,

 

There is requirement like download image from SharePoint Online and display it in email inline. I have written a ServiceBroker method where I am downloading the image and setting it to property AdImage of SOType.Image. In the workflow I have mapped this SmartObject property in the Email body part of my email event. When testing this method using SmartObject tester utility I am able to see the image under results. But somehow its not showing the image instead its showing the base64 string as content in email body. I have attached both the images.

 

Can anybody please let me know the reason why its not showing the image in email body.

 

Thanks in Advance.


13780i5530790260861C7E.png
16629i51F317F1970BEF72.png

1 reply

Userlevel 1
Badge +8

There are actually a couple of issues at play.

 

First, the smart object content value as you discovered isn't binary data, it is Base64 encoded.

 

Second, the mail event is not going to support embedded images. (That was the motivation to write my own email template broker)

 

There maybe a workaround you will have to put an image tag in the body of you email and modify the src attribute to point to a web handler. There may be one out of the box in smart forms that would fill the gap. I don't have it where I can research at this moment, but I wanted to toss this out here in case someone else happen to know off the top of their head. :)

 

Sorry I don't have a more complete answer. There really isn't a great solution to this. Even if you go the web handler route, that handler will need to be accessible by all recipient of the email for the image to render.

 

S.

Reply