MojoMotor User Guide Version 1.2.0


MojoMotor Contact Form

This tag creates a contact form that your guests can use to send you email. To show your contact form use this tag pair:

{mojo:contact:form}

{/mojo:contact:form}

The contact form is created similar to a standard web form, only you do not specify the opening and closing form tags; MojoMotor takes care of those for you. Here's an example:

<h3>Contact Form</h3>

<!-- The following parameters are allowed also: 'name', 'id', 'class', 'style' -->
{mojo:contact:form from="contactform@example.com" recipients="admin@example.com, someone_else@example.com" return="contact_thank_you"}

<!-- Reply-to Name (optional) -->
<p><label>Your Name: <input type="text" name="reply_to_name" value="" /></label></p>

<!-- Reply-to Email (optional) -->
<p><label>Your Email: <input type="text" name="reply_to_email" value="" /></label></p>

<!-- Subject (optional; can also be provided as a parameter) -->
<p><label>Subject: <input type="text" name="subject" value="Website Contact form" /></label></p>

<!-- Message (required) -->
<p><label>Message:<br /> <textarea name="message" rows="5" cols="70"></textarea></label></p>

<!-- MojoMotor will accept any number of optional arbitrary fields, and these will automatically be
included in the email -->
<h4>These fields are optional</h4>
<p><label>One: <input type="text" name="one" /></label></p>
<p><label>Two: <input type="text" name="two" /></label></p>
<p><label>Three: <input type="text" name="three" /></label></p>

<p><input type="submit" value="Send it off!" /></p>

{/mojo:contact:form}

Parameters

from=

from="contactform@example.com"

The email address to send the form as. If the email isn't valid, or if this parameter is not provided, MojoMotor will fall back to the email of the admin user who installed it.

subject=

subject="This is my email subject"

This allows you to set a subject for the email. If you set this parameter, you should not include a subject field in your form.

name=

name="myForm"

This allows you to set a name= attribute for the form.

recipients=

recipients="admin@example.com"

The recipients parameter allows you to specify the email address of the person (or persons) you want to receive the email. If you have more than one recipient, please separate each email address with a commas:

recipients="admin@example.com,ceo@example.com,president@example.com"

return=

return="page_name"

The Page you want the user sent to after the form is submitted.

class=

class="my_form"

Sets the form's class, enabling fine-grained styling of the form.

id=

id="contact_form"

Sets the form's id.

style=

style="border: 1px solid black;"

With this parameter you can specify additional styles within the form tag.

Form Fields

The following form fields can be used inside your form, and MojoMotor will send the submitted information in the email:

Message

The main body of the email should be in a field with the name "message". This field is required.

Subject

If you want your guest to be able to provide their own subject, you can include a field named "subject". If present, this will override the subject specified in the subject parameter.

Reply-to Email

You can include a field named "reply_to_email" in which guests can enter their email address. This will allow you to reply directly to them from your email client.

Reply-to Name

If you're using the reply_to_email field (above), you can also include a field named "reply_to_name" in which guests can enter their name. This will allow their name to appear in addition to their email address when you reply to them from your email client.

Optional Fields

Other than "subject", "message", "reply_to_email" and "reply_to_name", MojoMotor will simply pass any additional fields it finds within your contact form into the email.