Is it possible to present the HTML in the Email body as an Image in a portal widget?

tor-werner
Giga Contributor

As we know the Body part of sys_email contains HTML code that can be previewed by pressing the 'Preview HTML body' button.
I stripped much of the HTML code so I ended up with a preview in my example below.

Is it possible to get a portal widget to read and present the same as we see here?

A possible solution could be to define an Inbound Email Action that reads this particular mail, then a script that strips the HTML code in the body, same way as I did manually. But from here and to get it presented in the Portal, my knowledge stops. I don't even know if it is possible.

find_real_file.png

1 ACCEPTED SOLUTION

Matthew Glenn
Kilo Sage

If I understand you correctly, it's possible and we're doing something similar.



You can have your widget either read directly from the sys_email table, or, as you said, you can use an inbound action and then read that target record. The latter is what we've done.



In your inbound action, use 'email.body_html' to grab the html of the inbound notification and copy that to an HTML field on your target table.



From there, in your widget, grab the displayValue() of that HTML field and you'll have what you see in the email.



Here's the inbound email we received


Screen Shot 2018-02-01 at 23.16.54.png



Here's what it looked like displayed on our Portal


Screen Shot 2018-02-01 at 23.19.25.png




If you need any more info, I'd be happy to help.


View solution in original post

6 REPLIES 6

Matthew Glenn
Kilo Sage

If I understand you correctly, it's possible and we're doing something similar.



You can have your widget either read directly from the sys_email table, or, as you said, you can use an inbound action and then read that target record. The latter is what we've done.



In your inbound action, use 'email.body_html' to grab the html of the inbound notification and copy that to an HTML field on your target table.



From there, in your widget, grab the displayValue() of that HTML field and you'll have what you see in the email.



Here's the inbound email we received


Screen Shot 2018-02-01 at 23.16.54.png



Here's what it looked like displayed on our Portal


Screen Shot 2018-02-01 at 23.19.25.png




If you need any more info, I'd be happy to help.


Thank you so much Glenn


This is exactly what I had in mind.


There is only one issue that I discovered after I posted my question. I did all of this manually and copied the html code from the email directly into the widget. I got the email presentet, but to be able to see the report/image, it required authentification. The email is sent from an external Application that requires login/authentification.


I will discuss this with my customer.



Kind regards


Tor


Hello Matthew, 
 
I'm trying to build a widget for custom major incident status page.. 
 
I was thinking to build a widget that reads the outbound emails for a specific incident( active/current ) which will be displayed in the portal  > MI status page . 
 
What you have looks very similar with what i have in mind. Can you pls give me more details on how you approach this . I'm really new to snow development and I'm curios how you managed to get it work. 
 

Thank you

 

 

sax10or
Tera Contributor

Hi Matthew,

I hope you are fine and will be able to help me on my customer requirement.

I think it is a bit different that what was discussed above.

The need is to send a widget's displaying in a notification body.

In other words, embeded a widget in the HTML body of a notification.

I know that there is the possibility to send a link to the Service Portal page by notification but my need is quite different because we need to send the image of the widget into the email's body.

Hope you have time to read me.

Regards.