1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle
.MonoRail
.Framework
17 using System
.Collections
;
18 using Castle
.Components
.Common
.EmailSender
;
21 /// Represents the disacoupled service to use
22 /// MonoRail's view engine to process email templates.
24 public interface IEmailTemplateService
27 /// Creates an instance of <see cref="Message"/>
28 /// using the specified template for the body
30 /// <param name="templateName">Name of the template to load.
31 /// Will look in <c>Views/mail</c> for that template file.</param>
32 /// <param name="layoutName">Name of the layout.</param>
33 /// <param name="parameters">Dictionary with parameters
34 /// that you can use on the email template</param>
35 /// <returns>An instance of <see cref="Message"/></returns>
36 Message
RenderMailMessage(string templateName
, string layoutName
, IDictionary parameters
);
39 /// Creates an instance of <see cref="Message"/>
40 /// using the specified template for the body
42 /// <param name="templateName">Name of the template to load.
43 /// Will look in <c>Views/mail</c> for that template file.</param>
44 /// <param name="layoutName">Name of the layout.</param>
45 /// <param name="parameters">Dictionary with parameters
46 /// that you can use on the email template</param>
47 /// <returns>An instance of <see cref="Message"/></returns>
48 Message
RenderMailMessage(string templateName
, string layoutName
, object parameters
);
51 /// Creates an instance of <see cref="Message"/>
52 /// using the specified template for the body
54 /// <param name="templateName">Name of the template to load.
55 /// Will look in <c>Views/mail</c> for that template file.</param>
56 /// <param name="context">Context that represents the current request</param>
57 /// <param name="controller">Controller instance</param>
58 /// <param name="controllerContext">The controller context.</param>
59 /// <param name="doNotApplyLayout">If <c>true</c>, it will skip the layout</param>
60 /// <returns>An instance of <see cref="Message"/></returns>
61 Message
RenderMailMessage(string templateName
, IEngineContext context
,
62 IController controller
, IControllerContext controllerContext
, bool doNotApplyLayout
);