开发者

Business layer what's best solution to incorporate Email Templates

I'm asking the best solution for a very 'simple' problem.

Today, I have emails templates files and also the logic for sending those emails, on my frontend/website.

Now, I'm improving my code by开发者_Python百科 removing any Mail logic to my BL. So my idea is to have my Business Layer (BL) project, responsible for sending emails, if some business behaviour occur, and not the frontend.

The question that I have, is that I must still be able to change the templates without requiring to compile the BL project.

Do you have any good solution?


There are several solutions for this problem , One of them is to save the template in Xml file.


You can simply add folder in your BL project and put your mail templates in it. Then set build action of each file (mail template) to "Content". Just mark a file, go to properties, then you will see "Build action".

Another solution is to have them saved in database (if you use DB in your project).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜