Overview
The size of a rendered email can impact how it’s displayed by receiving clients. For instance, Gmail may clip messages that exceed its file size threshold, while other providers may apply stricter spam filtering to larger emails—potentially affecting deliverability.
The Sculpt Editor includes an Email Size Indicator to help you monitor message size as you build. Located in the editor toolbar, the scale icon displays the estimated rendered size of your email (for example, 12.4 KB out of a 100 KB limit). When your message exceeds 100 KB, the icon turns orange to alert you that it has crossed the threshold at which Gmail and some other email clients may clip the content. This makes it easier to optimize your email before sending and avoid potential display issues.
Smarty {capture} tags
You can also use the Smarty {capture} tags to further reduce the resulting email size. Content between the capture tags is stored in a variable, giving you the opportunity to output those values or choose not to render them as part of a message.
The capture tags are ideal for Smarty logic that repeatedly iterates through data and does not output any valid HTML. This logic can add unnecessary bulk to your messages in form of carriage returns, whitespaces, code comments, and other content not intended for email recipients to see.
Capture tags should only be used to surround the Smarty business logic and not the logic used to render data in a message. Always preview and test your messages when using capture tags as removing whitespaces can affect rendered messages.
Example
An example of using {capture} tags around the {foreach} statement that does not output message content:
{capture 'blackhole'}
{foreach $data as $key => $value}
{$foo[$key] = $value}
{/foreach}
{/capture}The capture tag accepts the optional name attribute as the first argument, which we are using to add the custom label 'blackhole'. In our example, capture tags with this name are reserved for hidden content that will not be rendered.
We omit the capture tags for Smarty logic that will display message content:
<ul>{foreach $foo as $key => $value}
<li>$value</li>
{/foreach}
</ul>
Comments
0 comments
Please sign in to leave a comment.