Created
April 12, 2020 15:42
-
-
Save mattcuk/7762a0e8301e0ce80ffee191e51c5795 to your computer and use it in GitHub Desktop.
Azure Logic App - Inline Code - Generate HTML for an Email Body
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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