change email address for autoresponse

Moderator: crythias

Post Reply
johnn
Znuny newbie
Posts: 2
Joined: 14 May 2010, 00:25
Znuny Version: 2.4

change email address for autoresponse

Post by johnn »

Situation:
customer enters message into email-enabled form on a blog. (it's contact form 7 on wordpress).

For reliable delivery, all emails are sent to OTRS from a single, known email address, hardcoded in the wordpress SMTP plugin. The customer types their email address as data into the wordpress form.

What I need is for OTRS to retrieve the customer email address from the form and use it as the target for the auto-response.

I've been trying, with some success, to set X-OTRS headers on the wordpress form. I can, as a test, for example, set customer ID to an arbitrary string.

What I can't work out how to do is capture the customer email address from the incoming mail (body or header) and use it for the auto-response.

Has anyone any pointers?

John
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: change email address for autoresponse

Post by crythias »

This PostMasterFilter worked for me (change #customer to your appropriate label):

Code: Select all

Filtername:	
Match:
Header 1:	Body	Value:	#customer ([a-zA-Z0-9_\-\.]+)@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})
Set:
Header 1:	X-OTRS-CustomerUser	Value:	[***]

Filtername:	
Match:
Header 1:	Body	Value:	#customer (([a-zA-Z0-9_\-\.]+)@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3}))
Set:
Header 1:	X-OTRS-CustomerNo	Value:	[***]
This shows up on log:
Tue May 4 12:25:52 2010 notice OTRS-CGI-10 Filter: 'Customer change email' Set param 'X-OTRS-CustomerNo' to 'user@address.com
Tue May 4 12:25:52 2010 notice OTRS-CGI-10 Filter: 'Customer change User' Set param 'X-OTRS-CustomerUser' to 'user'
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
johnn
Znuny newbie
Posts: 2
Joined: 14 May 2010, 00:25
Znuny Version: 2.4

Re: change email address for autoresponse

Post by johnn »

Thanks crythias, I'll start looking more deeply at filters, for this and other automation. I think yours is a better example than in the docs.
Meanwhile I found that setting the Reply-To header in the form seems to work - OTRS sends auto- and manual responses to the right place, and seems to treat the Reply-To as the customer email address. Needs a bit more testing though.
Post Reply