Re: [rt-users] OnCreateSetLanguage dependent on the Email To addr

2011-02-18 Thread Daniel Schwager
The list server mixed up my example, therefore again:

Example: Sending an email to
  a) support [at] example dot COM : set English to the requestor
language,
  b) support [at] example dot DE  : set German to the requestor
language.

regards
Danny



[rt-users] OnCreateSetLanguage dependent on the Email To addr

2011-02-17 Thread Daniel Schwager
Hi,

We would like to answer ticket in ONE
queue called support using different languages.

The language depends on the language of the requestor.

If the requestor has no language set, we have to set
the language automatically (scrip) dependent on the 
To-email-addr used for creating the ticket. 

Example: Sending an email to
a) supp...@example.com set English to the requestor language, 
b) supp...@example.de set German to the requestor language.

The Correspondence-Template checks the language of the requestor
and changes the language for the signature dynamically.


Scrip name: OnCreateSetLanguage
Precondition: ticket.isReceivedByEmail()  !requestor.isSetLanguage()
Action: requestor.setLanguage(depend on To-emailaddr)

** Precondition:
# isReceivedByEmail()
my $inMessage = $self-TransactionObj-Attachments-First; 
return 0 if ( !$inMessage ); # if no message attachment - assume web UI 
return 0 if ( !$inMessage-GetHeader('Received') ); # exit if not email
message

# !requestor.isSetLanguage()
..

Can somebody help me to create the Precondition and Action ? Currently I
stuck... )-:
 
Kind regards
Danny