I have a very interesting situation that I hope someone can help me with. I currently have a custom email campaign system set up for a client that is coded using cold fusion (but this isn't relevant) anyway, What they see in the campaign design bit is a CKEditor for every section (if they decide they want more than one section.) Here's my problem, the clients sometimes don't specify widths on their images, and sometimes they use images with widths 5k+. So I have in the email template:
<style type="text/css">
img {
max-width: 100% !important;
height: auto !important;
}
</style>
Which works great... except for Gmail, one of the most popular email clients.
What I dreamed up: somewhere in CKEditor, it would be really nice if after an image was inserted into the rich text editor, this snippet would be executed:
document.getElementsByTagName("img")[0].setAttribute("max-width", "800px");
document.getElementsByTagName("img")[0].setAttribute("height", "auto");
or
img.style.maxWidth = "800px";
img.style.height = "auto";
Is that possible? or am I just spinning my wheels? Thanks for your time and patience!
setupDimentionfunction). Non-minified version is available on CKEditor site.