Orchard Contact Forms
Asked Answered
J

1

10

I've been trying to setup a contact form via Orchard CMS v1.6 but I'm not really sure how to do it.

I tried installing the Custom Forms module but i think this isn't compatible with the latest version I'm using.

Any suggestions?

Jahdol answered 1/2, 2013 at 10:22 Comment(0)
G
14

The Custom Forms module is very powerful and flexible, but it's not obvious at first how to make a contact form using it. Once you've figured it out though you can do a lot more with it.

Step 1 - Create a content type for the contact information you want to collect

In /Admin/ContentTypes click 'Create new type' to make a type with all the info you want your user to fill in.

Step 2 - Create a Contact Custom Form Page

In /Admin/Orchard.Customforms create a new form. On the drop down for content type choose the new content type that you made in step 1. You probably want to also tick the 'Save the content item once the form is submitted' box. You don't need to as step 3 will show how to make it email you, but I like to do it in case there is a problem with email.

Step 3 - Create a rule to send you an email (In Orchard > 1.7 use a workflow)

In /Admin/Rules create a new rule.

In the events section select an event for When a custom form for types (Your new content type) is submitted.

In the actions section add an action to send an email. If you choose to send to admin, make sure you've given the admin user an email (or it just fails silently).

You can use tokens in the subject and body of the email. Mine looks like this:

**Subject:** Orchard Contact Form - {Request.Form:Contact information.Name.Text}

**Body:** Name: {Request.Form:Contact information.Name.Text}
Email: {Request.Form:Contact information.Email.Value}

{Request.Form:Contact information.Yourmessage.Text}

Name, Email, and Yourmessage are all the field names on the my 'Contact information' type. For you these will need to be the name of your content type and the fields you've added to it.

That's it.

Update: In Orchard 1.7 workflows have replaced rules. This blog post goes into more detail about how to use them to make contact form.

Gog answered 1/2, 2013 at 14:30 Comment(8)
You're not kidding when you say its not obvious, works great once you get going thank you for the help. My only question that i have is how to set a value to a dropdownlist of a custom form? Seems to only display/post the name of it when i would like to retrieve the email value behind the selection on posting via the email rule interface.Jahdol
I'm not sure what you mean. Ask as a new question, with some more detail and what you've tried so far and I'll have a look.Gog
Posted a question, here's the link. #14686261Jahdol
I'm getting a 404 when hitting /Admin/Rules. I'm not using a form just a Custom Form Widget. Is it necessary i have a form as well?Inhabitancy
You should be able to get to Rules from the admin dashboard menu.Gog
Didn't have the module enabled. Working fine now. Thanks.Inhabitancy
In Step 3, in the actions section, I don't see an option to send an email. Is there another module that I need to have installed/enabled to be able to see that?Danieu
Answered my own question...I found that I needed to have the Messaging and Email Messaging modules installed and enabled.Danieu

© 2022 - 2024 — McMap. All rights reserved.