We have created a email and for which the content is populated from a external source and we are using API callouts.The response from the API callout is very huge JSON output which comes around 5000 lines. I am familiar with AMP script and SSJS however since the JSON is big i prefer using SSJS which is very simple. So my question is if we use SSJS in email templates is there any drawbacks? And some times the response from API takes longer and which causes the delay in email deliveries.So is there any guidelines when using API callouts in emails?
I would recommend moving the SSJS call to a script activity and have it populate a Data Extension. Then send the email using AMPScript Lookup() on the DE or AttributeValue() functions to get the info you need in the email.
SSJS by itself is super slow in emails, add in API calls (especially with a large payload) and you are looking at super slow send times with the likelihood of timing out.