4 ms·
How we built our HTML email editor using liquid, wysihtml5 and premailer
- corkill 14y agoWhat service do you use to send the emails?
- dullboy 14y agoHow do you handle the problem that there might be HTML tags between "{{" and the keyword "content", or between "content" and "}}" ?
- jrallison 14y agoJohn at Customer.io here. When a customer attempts to save a layout, we perform several validations including verifying valid liquid templating (http://liquidmarkup.org/ http://liquidmarkup.org/) syntax and the presence of the "content" liquid tag. If there are HTML tags between the "{{"'s, we'll present a user friendly error message. Cheers!
- dullboy 14y agoOkay, thanks for the reply. I myself had done the same thing for some clients. The clients were quite confused when they saw the error message after pasting text from some external rich text editor that littered everything with <span>s. I wonder if there is a better way...
- jfhollingworth 14y agoOut of interest, is that using https://github.com/jhollingworth/bootstrap-wysihtml5 https://github.com/jhollingworth/bootstrap-wysihtml5?
- jrallison 14y agoHey James, This is John at Customer.io here. We are absolutely using your work. It was a joy to use. Thanks so much!
- jfhollingworth 14y agoAwesome! I'm glad you like it :)
- chadyj 14y agoGreat work guys! I think you hit the nail on the head with the template style being the best approach for easily putting together emails with clean code. HTML email editors are in a terrible state and that is why I have created Sendicate (http://sendicate.net http://sendicate.net) For more reasons why you should ditch the traditional WYSIWYG style approach have a look at: 1. http://www.chadyj.com/post/21569743980/content-sections-as-poetry-an-email-wysiwyg http://www.chadyj.com/post/21569743980/content-sections-as-p... 2. http://www.chadyj.com/post/21158280879/die-wysiwyg-die-lets-focus-on-content-instead http://www.chadyj.com/post/21158280879/die-wysiwyg-die-lets-... 3. http://www.chadyj.com/post/20729167319/email-newsletters-are-broken-there-has-to-be-a-better http://www.chadyj.com/post/20729167319/email-newsletters-are...
- drivebyacct2 14y agoI'm trying really hard not to scoff. This is pretty much a standard way of doing any sort of embedded content in any templating system or language that has ever existed. Ever. I'd recommend running the child HTML through some sort of validation to clean up the markup or otherwise ensure it doesn't alter the content that follows it in the template. Also, depending on your userbase, it may be easier, or actually recommended, to use something like Markdown instead. It won't let them shoot themselves in the foot like HTML or a rich text editor will. I've seen content that was heavily formatted and styled that looked atrocious in the template, do to the template's parental styling or just poor user taste.