Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to reply to email to update database

Status
Not open for further replies.

dkemas

Programmer
Mar 22, 2012
70
GB
I submitted a support call via a website ticket logging system, when they replied I was sent an email. I could simply reply to the email to submit my comment and this updated the ticket system directly (when I log into the web based ticket system I can see my email reply as though I replied directly on the system).

How did they do this? Can someone provide a starting point for me to research on, my initial google returned nothing.

Thanks
 
Hi

As I understand, you want a mail processor. That will depend on the used operating system and the used mail delivery agent.

The subject was barely discussed in the past in thread434-1583036. But it has a few keywords to use in your further searches.

Feherke.
 
a number of ways.

the easiest is to use procmail or something to filter incoming emails and take an action based on their content. this has nothing to do with php.

the alternative that I use is to set up a cron job to attach to an imap store and download new messages. do some inspection of them and decide whether something is an email reply to a ticket, in which case strip the relevant bits of content and meta data out and shove it in the database.

for a php solution your starting point would be the imap functions in the php manual. plenty of vaguely) adequate examples in that.

for auto - recognition, the easiest is to generate both an x-header in the email header and a backup unique id in the body of the email. store that against the ticket and then search for the shape of the unique id in the parsing code. if you don't get a shape match then reply saying that the email does not correspond with any open ticket and ignore it. if you do get a shape match then carry on with the parsing and storing. so just make sure that the unique id is always in the same format.

the complexity comes with working out how and whether to handle attachments.

this is not hard, but is more complex than it sounds in this post.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top