Different template according to requestor email address

Hello,

There are tickets coming from internal users (@interal.aa) and from external
users (@gmail.com, @yahoo.com, etc).
I want to send different king of template according to requestor address.

Content-Type: text/html
{
if($Ticket->RequestorAddresses =~ /@internal.aa/) {
“You are internal”
} else {
“You are external”
}
}

Everything works fine if there are only one requestor (aaa@internal.aa or
aaa@google.com), but if there are situation like this (aaa@internal.aa,
aaa@gmail.com) both, the gmail.com and internal.aa mails get message saying
“You are internal”.

How can I separate these to get different messages according to their email
address?

View this message in context: http://requesttracker.8502.n7.nabble.com/Different-template-according-to-requestor-email-address-tp57533.html

How can I separate these to get different messages according to their email
address?

scrips uses lib/RT/Action/SendEmail.pm which is designed to send one
template to all scrip recipients.

it’s not unfaisible to send different templates to different recipients,
you have to hack this file (and maybe others) a lot …

Easter-eggs Spécialiste GNU/Linux
44-46 rue de l’Ouest - 75014 Paris - France - Métro Gaité
Phone: +33 (0) 1 43 35 00 37 - Fax: +33 (0) 1 43 35 00 76
mailto:elacour@easter-eggs.com - http://www.easter-eggs.com

How can I separate these to get different messages according to their email
address?

My first inclination would be to duplicate the Scrip(s) in question (e.g.
On Correspond Notify Requestors and CCs).

For the Internal Scrip change the template to be your internal template.
Put in a custom condition to see if any of the planned recipients are
internal - if no then bail out. Put in a custom action preparation code
that strips out any recipients which are not internal.

Now for the External Scrip do the same but check for external recipients,
strip internal recipients, and use your External template.

cheers
ram