Jump to content

Submit contact form as ticket


Jordan

Recommended Posts

Requirements:

Your support system MUST allow tickets from non-registered users. If you require users to be logged in, this method is not for you.

 

After looking through the thread new presales contact form -> inserts as sales ticket, Matt said that it would be easier to just link your contact as the support department URL. If you want to go that method, that's fine.

 

However, if you would like your users to be on contact.php (which uses contact.tpl) the following coding can help you set up your contact form to submit it to your support desk.

 

Instructions:


    - Log into your admin section, and create the "Contact" support department.
    - If you have email piping set up, don't forget to create the new contact email in your control panel using the pipe.php URL.
    - Manage your administrators/support users so that the new contact department is added to their account to view forms sent in [as tickets.]
    - Remember to make sure that support tickets can be sent by *all* users.
    - Create contact.html file and add the coding included below.
    - Locate <input type="hidden" name="deptid" value="004">
    in the coding. Replace value="004" with the value of your contact department. [if you're unsure of how to find this, go to yourdomain.com/admin/configticketdepartments.php/. Click on edit.gif. In the URL you will see the id at the end (eg: admin/configticketdepartments.php?action=edit&id=004)]
    - Upload the contact.html file to your template's directory.
    - Rename your original contact.tpl to contact.tpl.bak. This will ensure that you have a backup copy in case you want to revert to it later on in the future.
    - Rename contact.html to contact.tpl.
    - Voila!

 

By default I hide the priority, however you can simply remove the comment markings (<!-- ) before and after the <tr>, and it will allow the viewer to pick out a priority. I also left in custom fieds, so if you want to add custom fields for your form, you can do so. I also removed the ability to attach to the original contact form, however if a user screws up, they're shown the original template from supportticketstep2.tpl with the error message notifying them of what was wrong/missing.

 

This will also display the support form in it's entirety regardless if you removed it from the original coding or not.

 

See it in action (as if there's really anything special!): http://mywhmcs.com/contact.php

 

 

<form method="post" action="submitticket.php?step=3" enctype="multipart/form-data">

<input type="hidden" name="deptid" value="004" />

<table id="tablecontact" cellspacing="0" cellpadding="0">
<tr>
	<td class="fieldarea top">{$LANG.supportticketsclientname}</td>
	<td class="top">{if $loggedin}{$clientname}{else}<input type="text" name="name" size="30" value="{$name}"  />{/if}</td>
</tr>
<tr>
	<td class="fieldarea">{$LANG.supportticketsclientemail}</td>
	<td>{if $loggedin}{$email}{else}<input type="text" name="email" size="50" value="{$email}" />{/if}</td>
</tr>
<tr>
	<td class="fieldarea">{$LANG.supportticketsticketurgency}</td>
	<td><select name="urgency">
		<option value="High">{$LANG.supportticketsticketurgencyhigh}</option>
		<option value="Medium" selected>{$LANG.supportticketsticketurgencymedium}</option>
		<option value="Low">{$LANG.supportticketsticketurgencylow}</option>
		</select></td>
</tr>
{foreach key=num item=customfield from=$customfields}
<tr>
	<td class="fieldarea">{$customfield.name}</td>
	<td>{$customfield.input} {$customfield.required}</td>
</tr>
{/foreach}
<tr>
	<td class="fieldarea">{$LANG.supportticketsdepartment}</td>	
	<td>{$department}</td>
</tr>
<tr>
	<td class="fieldarea">{$LANG.supportticketsticketsubject}</td>
	<td><input type="text" name="subject" size="60" value="{$subject}" /></td>
</tr>
<tr>
	<td colspan="2" class="tdcenter"><textarea id="ticket" name="message" rows="10">{$message}</textarea></td>
</tr>
</table>

{if $capatacha}{$LANG.imagecheck}[img=includes/verifyimage.php] <input type="text" name="code" size="10" maxlength="5" />{/if}




<input type="submit" value="{$LANG.supportticketsticketsubmit}" />
</form>

 

If you'd like some CSS to pretty up the form as I did with mine ( http://mywhmcs.com/contact.php ) then you are welcome to use the following, which will ONLY be applied to the contact form (and no other tables):

 

table#tablecontact{
width: 95%;
margin: 0 auto;
text-align: center;
border-left: 1px solid #c6c6c6;
border-top: 1px solid #c6c6c6;
   }
table#tablecontact td{
background: #fff;
color: #727272;
       border-right: 1px solid #c6c6c6;
border-bottom: 1px solid #c6c6c6;
padding: 6px 6px 6px 12px;
font-size: 8pt;
text-align: left;
}
table#tablecontact td.fieldarea{
width: 150px;
background: #f0f7fe;
color: #333;
font-weight: bold;
text-align: right;
}
table#tablecontact td.tdcenter{
text-align: center;
}

 

If for some reason I forget a CSS style, or made an error... Do note it in the thread, and I will fix it immediately! :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated