mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 19:04:51 +08:00
Adding messageprepared flag to user registration email event handler to allow handler swaping.
--HG-- branch : dev
This commit is contained in:
@@ -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) {
|
||||
|
@@ -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>();
|
||||
|
Reference in New Issue
Block a user