Skip to content

Instantly share code, notes, and snippets.

@mattcuk
Created April 12, 2020 15:42
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mattcuk/7762a0e8301e0ce80ffee191e51c5795 to your computer and use it in GitHub Desktop.
Azure Logic App - Inline Code - Generate HTML for an Email Body
var titles = workflowContext.actions.Execute_JavaScript_Code.outputs.body;
var html = '';
titles.forEach(function(fulltitle) {
var title = fulltitle.substr(5); // Strip off the first 5 characters.. '12 - Headline' becomes 'Headline'
html += fulltitle +
' | <a href="https://www.somesite.com/find?q='+title+'">Somesite</a>' +
' | <a href="https://anothersite.net/search/'+title+'">Another</a>' +
'<br>';
});
html += '<br><br>Footer of email goes here';
return html;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment