avEIGHT has developed a plugin utilizing email piping to allow ticket creation in Woothemes’ Supportpress via incoming email. We used elements of the ostickets piping functionality – big props go to Peter Rotich of ostickets. This plugin makes SupportPress easier for your customers to use. Instead of forcing all users to log into your company’s SupportPress dashboard to submit a ticket, they can simply email their issue/request to <support@yourcompany.com> or any other email you’d like.
You’ll need control of your mail server. We have tested this with our postfix email server and it works well. We’ve included directions below…
The automailer script that runs on the mail server whenever an email is received at the configured email address is written in php, so you’ll need php cli installed on the mail server with curl installed as well. You don’t need a webserver installed on the mail server, just php cli should be fine.
We are working on ways to make this easier, specifically a hosted service that does all of the piping bits seamlessly - allow you’d have to do is forward your <support@company.com> email to a provided autogenerated address hosted on our servers, enter the valid authentication keys, and be done with configuration. More on this later…
Here’s How it Works
Customer emails support@<yourcompany.com> with a request for help/bug report/etc. Your email server pipes the email to automailer.php (or automail.pl script depending on your preference) script loaded on the email server. The script recieves the message, and sends a curl request to the plugin running on your site. You configure the plugin to only accept mail from one ip address, and you create a sufficiently long password that’s present in both the automailer script and in the WordPress dashboard to prevent unauthorized emails coming in. The plugin checks to see if the incoming email is present in the registered users section, and if so, creates a new ticket and assigns the ticket to the default user in Supportpress. If not, the user is told to register and to try to send the email again once registration has been completed. All correspondance with the user appends ticket numbers to the subject line, so customers can simply reply to emails dispatched by Supportpress and see their responses appear inline in the respective ticket thread. Attachments can be enabled or disabled in the admin settings section. When Attachments are allowed, and the customer attaches a file, it is uploaded to the server and shown under the ticket info above the thread in the usual spot.
Future Plans
The plugin is, in essence an email piping plugin, so I’m not really concerned with the sending of emails. Of course, to make a good mechanism for piping, I needed to manipulate a few of the outgoing emails to tack on a ticket id, but for the most part if you want to customize which emails go out to the customers at which point you’ll need to rely on another plugin. This plugin’s primary concern is that incoming emails (with, or without a ticket tag) are added successfully to the support ticketing system. In a future update I intend to expand the emailing options set, but for now I am comfortable with the basic config.
Setup
You’ll need to have php5 installed on the webserver end, with Mailparse pecl library on the webserver as well. Check out this link for a good tutorial to install mailparse on ubuntu. http://forum.cerb4.com/showthread.php?t=244 The mailparse step is very important – emails won’t come in to the support site without it. We’ve tested with the latest supportpress theme and the latest wordpress version (3.4 as I write this) So make sure everything is up to date.
Let’s take a look at the admin panel for the Email Piping Plugin:
1. Allow attachments – If this is unchecked, customers’ tickets with files attached will be posted (If they are registered) however the attachment will not be uploaded, and the customer will be notified that the attachment was not uploaded.
2. Allow Email Piping – This disables/enables email piping.
3. Whitelisted IP – Enter your mail server’s IP address in this field. Only connections from this IP address will be acknowledged by the plugin.
4. API Key – This plugin creates an API that’s listening for emails. As such, you’ll need to set up a password, at least 16 characters for security that exists in the automailer.php script on the mail server, and here in this field. You’ll only need this string for the next section of the Setup process, you won’t be prompted for it in the future.
Directions We Used with Postfix on Mac os X
We run a Mac os X server install for our email, and the below line is what we used to install email piping on an already active email user “support”
1. open up the automailer.php/pl script
On/around line 25 you’ll see a config array like this
$config=array(‘url’=>’http://<your-url-here>/wp-content/plugins/email-reply/api/pipe.php’,
‘key’=>’<your api key here>’);
Replace the empty values with the appropriate values. The api key refers to the >= 16 character password you entered earlier.
1. Open up the postfix alias config file:
sudo vi /etc/postfix/aliases
2. Add a line for your redirection:
support: |<absolute path to>/automail.php
Make sure execute flags are on for the piping script
refresh your aliases, with (check your servers docs) the command “sudo newaliases” and now the contents of any emails appearing in the ‘support’ email box of your domain name will be sent to the piping processor running on your SupportPress webserver.
Recommendation
When comments are posted on a post you create, a “New comment” email is sent out. SupportPress used this “New Comment” email form to alert users that someone, probably a support tech, has responded to their ticket. The problem is, however, that this template contains all types of junk, like options to “spam it” or to “trash it” etc. I used a very useful plugin to help with this, and allow for replies right from the received email. The plugin is Comment Emailer by gordon french http://wordpress.gordonfrench.com/comment-emailer/ I think this does a really good job at providing some flexibility for the comment emails. Specifically you’ll want to change the reply to email to your support email into supportpress.
Purchase plugin
UpdatesPlugin details
Release date:
April 1st, 2012
Author:
Bryan Purcell
Plugin Type:
WooThemes SupportPress
Current Version:
1.0.1 – No change log yet
*registration required
