How do I post website forms to Relenta?

Posted in Lead capture

You can post forms from your website directly to Relenta via our form post API. This requires the following modifications to your existing form:

  1. Change the form action to post to
    http://YourAccountID.relenta.com/api/httpform
  2. Change the field names to match contact fields in Relenta. If your forms contain additional fields that don’t correspond to the fields listed, include them in the body of the form contents.
  3. Add hidden fields containing:
    • department_key It is unique for each department and can be found in My Account > API tab
    • r_redirect URL of the thank-you page
    • subject Specify the subject as you want it to appear in Inbox
    • contact_groups Group names or IDs to which the contact should be assigned to (IDs can be found in My Account > API tab). Separate multiple groups with semicolon (;)
    • message_template Format the form contents the way you want it to appear in Relenta.


Forms posted to Relenta will appear in your Inbox as email messages that you can reply to, archive, delete, forward, apply filters to, and otherwise treat them as good old email.

HTTP form API example
<form action="http://YourAccountID.relenta.com/api/httpform" method="post" enctype="multipart/form-data">
<input type="hidden" name="department_key" value="YOUR DEPARTMENT API KEY HERE" />
<input type="hidden" name="r_redirect" value="http://www.yourwebsite.com/thankyou.html" />
<input type="hidden" name="subject" value="Website contact form" />
<input type="hidden" name="contact_groups" value="12345678;9876543" />
<textarea style="display:none;" name="message_template">
Name: {first_name} {last_name}
Email: {email}
Message: {message}
Best time to call: {time_to_call}
T-shirt size: {shirt_size}
</textarea>

First name: <input type="text" name="first_name" value=""/><br/>
Last name: <input type="text" name="last_name" value=""/><br/>
Email:
<input type="text" name="email" value=""/><br/>
Phone:
<input type="text" name="phone" value=""/><br/>
Office phone:
<input type="text" name="phone(office)" value="" /><br/>
Billing address:
<textarea name="billing|address"></textarea><br/>
Message:
<textarea name="message"></textarea><br/>
Best time to call:
<input type="text" name="time_to_call" value="" /><br/>
T-shirt size:
<select name="shirt_size">
<option value="S">Small</option>
<option value="M">Medium</option>
<option value="L">Large</option>
<option value="XL">X-Large</option>
</select><br/>
<input type="submit" name="submit" value="Submit" />
</form>

NB: If email submitted with the form already exists in the department, the form submission will be assigned to it, but the contact information will not be updated as a security precaution.

NB: message_template - include any form field names, even if they don’t correlate to Relenta contact fields. If the field isn’t recognized, its value will be recorded in the created message (line-item in the activity stream).

Relenta contact fields:
first_name
last_name
email
company
job_title
contact_comments

Example:
<input type="text" name="company" value="Relenta, Inc" />
<input type="text" name="email" value="helpdesk@domain.com, other@domain.com" />

Additional contact information:
[block name|]field[(label)]

Recognized fields:
phone
fax
address
website
messenger
text

Both block name| and (label) are optional.

Examples:
<input type="text" name="phone" value="555-1212" />
<input type="text" name="phone(work)" value="555-1212" />
<input type="text" name="Billing|phone(work)" value="555-1212" />

Custom contact fields:
custom_field(field_name)

If you have custom contact fields created, you can populate them with information from the submitted form using any type of input. Input name should be "custom_field(custom_field_name)" as in the following example:
<input type="text" name="custom_field(order_id)" value="2234798234" />