[rt-users] Alter "From" field in template

Kevin Falcone falcone at bestpractical.com
Tue Jun 25 15:03:52 EDT 2013


On Tue, Jun 25, 2013 at 06:45:14PM +0100, Giuseppe Sollazzo wrote:
>    Hi there,
>    we currently have several queues each responding to a different e-mail address.
>    However, all replies come via the generic "support" e-mail address.
>    I tried editing the template to do this. In the template the first part changes, successfully,
>    the Subject of a message according to the queue.
>    What happens is:
>    - if I only leave the part of the script for Subject, this works as expected
>    - if I add the part of the script to change the "From" field, both don't work.
>    The structure of my script follows.

I'm assuming everywhere you say "Script" you mean "Template".

If you want to change headers, they have to go at the top.  Look at
your code, it inserts a newline and $Transaction->Content.

I'm betting the mail goes out with a trailing From: at the bottom.

Put your From: first.  Templates are like emails, Headers, blank line,
body.

>    Subject: { if ($Ticket->QueueObj->Name eq 'Z')
>    { "Z Support Job Logged: " . $Ticket->Subject . "
>    Thank you for contacting Z.
>    -------------------------------------------------------------------------
>    Initial request details:
>    " . $Transaction->Content . "
>    ";}
>    elsif ($Ticket->QueueObj->Name eq 'W')
>    {...}
>    From: { if ($Ticket->QueueObj->Name eq 'Z')
>    { "z at sgul.ac.uk";}
>    elsif ($Ticket->QueueObj->Name eq 'W')
>    { "w at sgul.ac.uk";}
>    else
>    { "support at sgul.ac.uk";
>    }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 235 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20130625/0c9954ea/attachment.sig>


More information about the rt-users mailing list