Workflow for Closing Comments and Sending Emails

Topics: General
Aug 13, 2013 at 9:47 PM
Edited Sep 15, 2013 at 4:19 PM
Hi,

I'm not sure if this query belongs in this section or not. Apologies if this is not the right place for asking!

I seem to be having some issues getting 2 workflow scenarios up and running.

Scenario 1: Close comments after 5mins.

Image
Image

I have a workflow which has a Content Published (BlogPost) joined to a Timer set to 5mins which is joined to a Close Comments rule.
I have turned the Content Published 'on' to active it and Saved the rule.
If I create a new blog post and turn comments on (with threading), I see the comment area active - as expected.
If I wait 10mins and refresh the page the comments area is still active.
Am I forgetting a step here?

Scenario 2: Send email when custom form is posted.

Image
Image
I have a workflow with a Content Published (Contact Form) joined to an Email section that takes the contact form email, subject and message entered and sends it to the owner (me).
My email address is setup under my User account details.
My SMTP email settings are correct and setup under the settings section.
If I open the form and submit the details I don't receive any email from the site.

Maybe there is a way to turn on logs or something to help me trouble shoot these workflow issues? I just started getting stuck into Orchard so these might be very obvious 'noobie' queries.

Thanks in advance for the help :)

Regards,
Rich
Coordinator
Aug 13, 2013 at 9:53 PM
For the blog post, please ensure that the initial set is correctly defined, it should be gray. Then ensure you Save it. Also, on the Content Published activity, configure it to handle Blog Posts.

For the form, with 1.7 right now you need to pipeline two event: Content Created and Content Published. Then plug it to an Email action. In 1.7.1 you will just need Content Created.
Aug 13, 2013 at 9:59 PM
Hi sebastienros,

Thanks for the swift reply!

I've added some images while you were responding to help make it a bit clearer what my current setup looks like.

For the form, it sounds like I'm missing the Content Created block initially. Not sure about the close comments part though. Sounds like I have everything there.

I will try this again in the morning when I have some time.
Aug 15, 2013 at 1:28 PM
Edited Sep 15, 2013 at 4:24 PM
Hi again,

I got the Contact Form sending the email. For anyone else interested the Workflow should be as I had it above but make sure you start with the Content Created -> then Content Published content type.

The 'Content Created' event is setup to use my Contact Form content type.

I also had to make sure the 'Save the content item once the form is submitted' checkbox was ticked where my form was setup. If this was not ticked then the email would not send. To make sure my database doesn't get clogged up with old submissions I added a step to delete the submission once it's sent. This works perfectly on Orchard 1.7 for me.

My Closing Comment workflow still isn't working though.

I altered the workflow to include a Content Created event and pointed it to the Blog Post type.

Image

This workflow does fire off the event. When I create a new post I can see '1 running' next to the workflow name however after 1 minute, regardless of the timer settings I have set, the blog comments are closed. Any idea what would cause this?

Hopefully it's just a small thing I'm doing wrong.

Thanks,
Rich
Sep 15, 2013 at 3:47 PM
Any chance you could fix the image links in this thread - I'm having exactly the same problem but can't seem to get it working. It stops at 'Content Published'.

Thanks..Ed
Sep 15, 2013 at 4:28 PM
Ed13 wrote:
Any chance you could fix the image links in this thread - I'm having exactly the same problem but can't seem to get it working. It stops at 'Content Published'.

Thanks..Ed
Hey, sorry about the missing pics - I changed hosting provider and forgot to point the file paths to my new image hosting setup.

To be honest, I went with the oForms module which handles emailing a contact forms details when submitted. I found this module to be very good and easy to use.

The Workflows just wouldn't trigger on times or do what I asked them to do but I'm sure this is just down to how I was setting them up as most people aren't having issues!

Hopefully it the next release we might get some Workflow documentation for comment use cases like:
Emailing forms
Closing comments after X number of days
etc

Rich
Sep 15, 2013 at 4:51 PM
Thanks for the speedy reply! My setup is very similar, so not sure what's causing it but always breaks (pauses) at Content Published - even if I tell it to publish it (which is does). Frustrating!

Hopefully as more people get into it some better documentation will start floating round. Until then I'll take a look at oForms to get something going...

Thanks again..Ed