views:

95

answers:

2

Hi there, 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 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?

A: 

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).

buhtla
Hi, DB is not a solution to me. I have tried your solution, but I don't have access to the files on my frontend project, so I can edit them. If I set to 'copy ...' the template will be inside my DLL, where I still can edit them
muek
+1  A: 

Hi muek:

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

DEVMBM
Hi, I know I to build the templates (I have some in xml), my question is where to keep the templates so could be updated without any compilation, and be used in BL
muek
PUt the template in an XML file and reference this file from the App.config (TemplateLocation = c:\mytemplate.xml.
sh_kamalh