mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-19 01:57:55 +08:00
Fixing email action when the user is not authenticated
This commit is contained in:
@@ -50,9 +50,9 @@ namespace Orchard.Email.Rules {
|
|||||||
if (recipient == "owner") {
|
if (recipient == "owner") {
|
||||||
var content = context.Tokens["Content"] as IContent;
|
var content = context.Tokens["Content"] as IContent;
|
||||||
if (content.Has<CommonPart>()) {
|
if (content.Has<CommonPart>()) {
|
||||||
var owner = content.As<CommonPart>().Owner.ContentItem;
|
var owner = content.As<CommonPart>().Owner;
|
||||||
if (owner != null && owner.Record != null) {
|
if (owner != null && owner.ContentItem != null && owner.ContentItem.Record != null) {
|
||||||
_messageManager.Send(owner.Record, MessageType, "email", properties);
|
_messageManager.Send(owner.ContentItem.Record, MessageType, "email", properties);
|
||||||
}
|
}
|
||||||
_messageManager.Send(
|
_messageManager.Send(
|
||||||
SplitEmail(owner.As<IUser>().Email), MessageType, "email", properties);
|
SplitEmail(owner.As<IUser>().Email), MessageType, "email", properties);
|
||||||
|
Reference in New Issue
Block a user