0

I am working on an email that is very very complex with tons of ampscript and SSJS covering for a lot of different scenarios. The amount of code is still increasing as we go and it holds calls to both Marketing Cloud, remote json and to SalesCloud.

In several other cases I have been using TreatAsContent() as I heard that it renders content with less strain for the server.

Would it be a good idea to move the major parts of this enormous code-chunk to a content block instead, and refer to it from TreatsContent() or could just as well leave as is?

This email is not ever part of a mass send, hence my question. It will be sent in a journey and probably not very many during a day.

...guess I have answered my own question here, but any info on best practice would be appreciated.

1 Answer 1

1

I once did a campaign with tons of ampscript; and on top of that, the stakeholders wanted to have different versions, tracked separately. Not really sure if it's a best practice or not, but here's what I did:

I divided the ampscript code blocks into several pieces (each were doing something separate), and saved them as content blocks. Depending on the version, and the difference, I called them within the email using ContentBlockById().

An expert in SFMC once told me that the TreatAsContent should be used if the values you're retrieving are text (copy). And I should use ContentBlockById() if I want to save ampscipt in pieces.

We ended up sending the emails to A LOT of people, and we've never experienced any issues with the send times. After seeing the performance, I've also switched the default header and footer settings to a similar setup, calling the correct content block with ContentBlockById() after a simple if/else statement. We haven't seen any rendering issues in the server so far.

Maybe this can help a bit.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .