EmailRouting: Difference between revisions
Jump to navigation
Jump to search
m (3 revisions imported) |
mNo edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 22: | Line 22: | ||
Custom action preparation code: | Custom action preparation code: | ||
<tt> return 1;</tt> | |||
Custom action cleanup code: | Custom action cleanup code: | ||
# Domains we want to move | |||
my $domains = {}; | |||
my %domain_map = ( | |||
'\@gmail\.com' => "Queue 1", | |||
'\@yahoo\.com' => "Queue 2", | |||
'\@hotmail\.com' => "Queue 3", | |||
); | |||
#Check each of our defined domains for a match | |||
foreach my $domainKey (keys %domain_map ){ | |||
if($self->TicketObj->RequestorAddresses =~ /^.*?${domainKey}/) { | |||
# Domain matches - move to the right queue | |||
$self->TicketObj->SetQueue($domain_map{$domainKey}); | |||
} | |||
} | |||
And of course modify this part to suite your own needs: | And of course modify this part to suite your own needs: | ||
<tt> '\@gmail\.com' => "Queue 1",</tt> | |||
Enjoy ! | Enjoy ! | ||
Jacob Baloul http://howtoforums.net | Jacob Baloul http://howtoforums.net |
Latest revision as of 21:19, 17 August 2017
HowTo Request-Tracker Email Routing using Scrips
http://howtoforums.net/viewtopic.php?p=32#32
If you're going to route different emails to different queues based on domains then you might just find this "Scrip" useful. Scrip - is a terminology used in Request-Tracker to basically create an automatic rule based on a condition.
1. Make sure the system group "Everyone" has the following permissions on the General Queue:
* CreateTicket * Comment on Ticket * Reply on Ticket
2. Create a Scrip on the "General" queue using the parameters below.
Description: Scrip Description Condition: On Create Action: User Defined Template: Global Template Blank Stage: TransactionCreate
Custom action preparation code:
return 1;
Custom action cleanup code:
# Domains we want to move my $domains = {}; my %domain_map = ( '\@gmail\.com' => "Queue 1", '\@yahoo\.com' => "Queue 2", '\@hotmail\.com' => "Queue 3", ); #Check each of our defined domains for a match foreach my $domainKey (keys %domain_map ){ if($self->TicketObj->RequestorAddresses =~ /^.*?${domainKey}/) { # Domain matches - move to the right queue $self->TicketObj->SetQueue($domain_map{$domainKey}); } }
And of course modify this part to suite your own needs:
'\@gmail\.com' => "Queue 1",
Enjoy !
Jacob Baloul http://howtoforums.net