0

I am working on an email template with a large number of modules. If I add these modules within the AmpScript IF-ELSE statement - for eg: Display module 1 table of code within in the If statement and hide module 2 table of code with in the else statement. Will this reduce my file size by not executing the code within the else statement? Or will the entire html in the file be sent through adding to the increased file size?

Please let me know!

Thank you, Sri

1 Answer 1

0

As Ampscript is interpreted in the backend, HTML content shown conditionally using logic does not count towards the size of the email, if it is hidden.

Consider this case:

%%[IF @lead == "MQL" THEN]%%
This is the message size if the condition is met
%%[ELSE]%%
This is the message size if the condition is not met
%%[ENDIF]%%

Keep in mind, that the Ampscript code itself also doesn't count toward message size.

The odd thing here, is in the context of Mobile Connect. When you build SMS messages, ALL the code (also Ampscript) counts towards your character limit og 160 characters. Even though it is not included in the final content of the message, when it is being sent. You can mitigate this by using %%=ContentBlockByKey()=%% in your message, placing the main part of the Ampscript outside of the SMS message.

2
  • Thank you so much for the detailed response! Commented May 15 at 16:09
  • You’re welcome. Remember to mark my answer as accepted if it was helpful. Commented May 15 at 16:57

You must log in to answer this question.

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