简体   繁体   中英

Storing HTML Templates versus Generating HTML Templates

This is rather a discussion I'm trying to start to get a better insight on how other people solve this problem:

On our web application we currently have the ability to store HTML snippets and pages in the database and render them or use them for email templates. Users have the ability to create or modifiy these templates.

Because we're expanding the functionality of the application, we rely on emails to deliver messages to the users of the application. These emails rely on the templates as well to generate content. The problem is that the emails are starting to get some high scores on the SPAM filters due the content of the HTML Snippets.

As a proof of concept I wish to remove the ability to create/modify these snippets and make them HTML compliant to reduce the SPAM scoring. The discussion i'd like to start now: Would you store these snippets in the database and call upon them when needed, or would you go with a hieracy of classes that can generate the correct HTML by accepting the required parameters?

What would you do and why?

You can generate PDF from any html you want and then send to user email. I do this way.

Have you taken a look at PostageApp ?

It has the ability to create HTML + CSS templates with automatic in-lining, which makes your design a lot easier. In addition, the preview function of the templates will let you know if you have used any invalid HTML or CSS markups, which might get flagged as spammy.

( Full Disclosure: I am the Product Manager of PostageApp.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM