Created
December 8, 2022 15:27
-
-
Save HubSpotHanevold/bf1e8e865d4be52099c0b3d37eaf7f35 to your computer and use it in GitHub Desktop.
Retrieving an email template from HubSpot to do a find and replace on the full body.
This file contains hidden or 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
let cloneId = inputData.cloneId; | |
let token = inputData.token; | |
let auth = 'Bearer ' + token; | |
fetch('https://api.hubapi.com/marketing-emails/v1/emails/'+ cloneId , { | |
headers: {authorization: auth} | |
}) | |
.then(function(res) { | |
return res.text(); | |
}) | |
.then(function(body) { | |
var output = {id: 1, rawHTML: body}; | |
callback(null, output); | |
}) | |
.catch(callback); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment