Setting character limits for editable content in email templates

austinc
Level 2

Setting character limits for editable content in email templates

I'm creating a Master Email Template, and wondering if there's a way I can set character limits for certain sections with editable content? (to prevent a writer from using too much text on a button, or header, etc.)

2 REPLIES 2
Dave_Roberts
Level 10

Re: Setting character limits for editable content in email templates

Im not aware of a way to set a fixed number of characters per input - be it an editable area (.mktoText) or a variable (${someText}) - using any of the native Marketo syntax.

 

While it lacks support in all email clients (so I wouldn't go this route) - you can do something close to this with CSS for reference.

Using CSS you can use the text-overflow property to truncate text based on a certain width (ex. 250px) of the parent element. Here's a link to an article on the CSS approach: https://css-tricks.com/snippets/css/truncate-string-with-ellipsis/

To be clear, this would not actually limit the text to a certain character count like you asked, but it would add an ellipsis (...) to the end of the text at the width limit (250px). This might serve to queue the user that there is too much text there, but would not allow for things like multiple lines of text in one "string" or "container". 

 

While the text-overflow will likely be supported within the context of the Marketo editor, it IS NOT supported by all email clients, here's a link to a support chart on that: https://www.caniemail.com/features/css-text-overflow/

 

You might be able to get away with something like this with Landing Pages where the CSS is more broadly supported by modern browsers, but maybe not the best solution for email. I hope this helps provide some context around the issue, sorry it's not directly a solution - I'd love to learn about it if there is, so thanks for asking this question here.

austinc
Level 2

Re: Setting character limits for editable content in email templates

Thank you for your response & resources. The text-overflow workaround/solution is also the only solution I've been able to think of. 

 

And although I was able to get it working in the editor, it didn't feel like the best alternative (would rather write out the ideal character limit in the sample text for copywriters). It was a good idea though, given the limitations we seem to have here. 

 

If I manage to figure out a solution, I'll certainly share. I can see it being a very practical addition to an email template. Thanks again!