Workflow for send email for commenting

Topics: Customizing Orchard, General
Nov 13, 2013 at 6:47 AM
I have created workflow to send mail message for comment. By this article:
http://weblogs.asp.net/bleroy/archive/2013/09/06/my-workflow-for-comment-notifications.aspx#comments

But I have get 2 messages for each comments:

Image

I think, it is because comment create action calls manager.Publish(content.ContentItem); two times.
Image

How to create workflow to send one email for one comments?
Coordinator
Nov 13, 2013 at 7:53 AM
What version of Orchard are you using? I get comment notifications every day, and don't see that problem.
Nov 13, 2013 at 8:02 AM
Edited Nov 13, 2013 at 8:13 AM
Orchard v.1.7.1 And as I see in version control it contains double Services.ContentManager.Create(comment);

Orchard.Source.1.7.1.zip https://orchard.codeplex.com/downloads/get/729933

But, last source code has:
https://orchard.codeplex.com/SourceControl/latest#src/Orchard.Web/Modules/Orchard.Comments/Controllers/CommentController.cs

Image


As I understand, bbdb4429e573 contains double Services.ContentManager.Create(comment);
https://orchard.codeplex.com/SourceControl/changeset/view/bbdb4429e573#src/Orchard.Web/Modules/Orchard.Comments/Controllers/CommentController.cs
Coordinator
Nov 16, 2013 at 6:28 AM
That code is perfectly normal as far as I can tell: the published comment workflow activity doesn't trigger on draft comments, so only the second one will fire your workflow. There has been a time when that wasn't the case but it has since been fixed.
Nov 21, 2013 at 12:12 PM
Edited Nov 21, 2013 at 2:48 PM
Could this be the same issue as this?
Nov 21, 2013 at 2:36 PM
No, I don't think so. My issue is bug in 1.7.1 version of Orchard CMS, in current sources it was fixed, so I hope 1.8 or 1.7.2 will not send two messages for comments.