Including jssp in your email delivery | Community
Skip to main content
isahore
Community Advisor
Community Advisor
June 20, 2020
Solved

Including jssp in your email delivery

  • June 20, 2020
  • 1 reply
  • 1617 views

Hi all experts,

 

I need a suggestion from the great minds out here.

I am trying to implement a way by which I can format content rendered from a third party source into my email delivery.

For example, I use the following code

<%@ include file="anyThirdPartyUrl" %> in my email delivery, which renders some content.

 

But I want to format the content before it is displayed in the customer's inbox.

What I tried was to call this "anyThirdPartyUrl" in a Jssp, format it the way I want and then call the Jssp URL in the email delivery like this

<%@ include file="jsspInMyMktInstance" %>

 

But this resulted in an error (failed to call/load directive). Not sure if this is at all possible, and I need some advice for the same.

 

Some more info: The third party URL returns a JSON, which I need to format and display in an HTML block (as images, text and links), for which I tried to use a Jssp in the middle. Not all email clients/users have javascript enabled, that is why all formatting logic cannot be applied directly in the email delivery itself (tell me if this assumption is not correct).

 

BR,

Ishan

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Jonathon_wodnicki

Hi,

 

I don't believe any email clients have ever allowed js due to the attack surface that would create.

To process the third party content, you can fetch it in the workflow with HTTPClientRequest, assign it to the delivery's variables, then add <% JSON.parse(variables.content) %> or <% eval(sanitizeThirdPartyCodeBeforeRunning(variables.content)) %> in the content.

 

Thanks,

-Jon

1 reply

Jonathon_wodnicki
Community Advisor
Jonathon_wodnickiCommunity AdvisorAccepted solution
Community Advisor
June 23, 2020

Hi,

 

I don't believe any email clients have ever allowed js due to the attack surface that would create.

To process the third party content, you can fetch it in the workflow with HTTPClientRequest, assign it to the delivery's variables, then add <% JSON.parse(variables.content) %> or <% eval(sanitizeThirdPartyCodeBeforeRunning(variables.content)) %> in the content.

 

Thanks,

-Jon