[SOLVED] Changing Customer From email address based on contents of body

Moderator: crythias

Locked
scravid
Znuny newbie
Posts: 7
Joined: 29 Apr 2016, 09:15
Znuny Version: 3.2.9
Real Name: David

[SOLVED] Changing Customer From email address based on contents of body

Post by scravid »

Hello all,

I've asked a similar question before now, but after a bit of a break, I've come back to the query and have also gotten a little further!

I can now successfully collect an email address from the body of the incoming email (using a regex :(\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b)...)

But, while I have hold of this address and can happily add it to a dynamic field, I can't find the right field to add the address as a customer email address. If I use OTRS-CustomerNumber it looks like it's going to work, but then when I hit reply from the ticket, it is still using the email address I sent the ticket from.

Can anyone advise?

Thanks a lot,

Scravid.
scravid
Znuny newbie
Posts: 7
Joined: 29 Apr 2016, 09:15
Znuny Version: 3.2.9
Real Name: David

Re: [SOLVED] Changing Customer From email address based on contents of body

Post by scravid »

No help on the internet, so I managed to engineer a solution myself!

To help anyone else who needs the same solution, here's what I did:

Select Admin/Sys Config/ Look for Core:PostMaster.

I then had to add 'Body' to the PostmasterX-Headers to be collected. Then, immediately under this, I ticked the first match filter:
PostMaster::PreFilterModule###1-Match and added the criteria below:

Match Body (newly added): ( \b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b )
Set From: [***] and Reply-To [***]

That's about it!

Hope this helps someone else.
Locked