Adding messageprepared flag to user registration email event handler to allow handler swaping.

--HG--
branch : dev
This commit is contained in:
Andre Rodrigues
2010-12-14 23:37:23 -08:00
parent ce1c032181
commit ac2e533343
2 changed files with 5 additions and 0 deletions

View File

@@ -20,6 +20,9 @@ namespace Orchard.Users.Handlers {
public Localizer T { get; set; }
public void Sending(MessageContext context) {
if (context.MessagePrepared)
return;
var contentItem = _contentManager.Get(context.Recipient.Id);
if ( contentItem == null )
return;
@@ -51,6 +54,7 @@ namespace Orchard.Users.Handlers {
}
FormatEmailBody(context);
context.MessagePrepared = true;
}
private static void FormatEmailBody(MessageContext context) {

View File

@@ -9,6 +9,7 @@ namespace Orchard.Messaging.Models {
public string Service { get; set; }
public ContentItemRecord Recipient { get; set; }
public Dictionary<string, string> Properties { get; private set; }
public bool MessagePrepared { get; set; }
public MessageContext() {
Properties = new Dictionary<string, string>();