[rt-users] choosing template on the fly - part 2
Dimitry Faynerman
dimitry.faynerman at hypermediasystems.com
Wed Dec 8 14:29:27 EST 2004
Hello,
Here's the original discussion about selecting template based on user's
language:
http://lists.bestpractical.com/pipermail/rt-users/2004-May/023084.html
and here's the solution posted on wiki:
http://wiki.bestpractical.com/index.cgi?action=revisions&page_id=ChooseTempl
ateByUserLang&revision_id=-1
this worked fine as long as tickets were created from RT.
However, now we need to create tickets by mail. We have separate scripts for
sending email for different languages.
So what I did was added a line to email header:
"X-RT-LANG" => "ja",
so that I could see which language to use. Then in the
RT::Interface::Email::CreateUser I use something like this:
my ($Val, $Message) =
$NewUser->Create(Name => ($Username || $Address),
EmailAddress => $Address,
RealName => $Name,
Password => undef,
Privileged => 0,
Comments => 'Autocreated on ticket submission',
Lang => $ParsedRTLang
);
so the user's language is setup as passed in the email header, and I
expected that that would be enough to force RT to use template selection
described in part 1.
However, for some reason it doesn't work. It seems to me that SendMail.pm is
not even being called when a ticket gets created from email. Is that true,
and if so what can I do about this?
Thanks,
Dimitry
More information about the rt-users
mailing list