[rt-users] Username and email address template is sent to

Ruslan Zakirov ruz at bestpractical.com
Wed Feb 22 14:16:29 EST 2012


On Wed, Feb 22, 2012 at 22:17, Brent Wiese <bwiese at elementps.com> wrote:
> I’m trying to find out how to print the username and email address of the
> person a template is being email to.
>
>
>
> So, for example, when you comment on a ticket, I want to add the following
> into the template:
>
>
>
> “This email was sent to Joe Blow (jblow at nowhere.com).”
>

Templates don't have access to this info in stock RT. It's easy to
adjust. Patch the following lines in lib/RT/Action/SendEmail.pm:

151 sub Prepare {
 152     my $self = shift;
 153
 154     my ( $result, $message ) = $self->TemplateObj->Parse(
 155         Argument       => $self->Argument,
 156         TicketObj      => $self->TicketObj,
 157         TransactionObj => $self->TransactionObj,
                ScripObj               => $self,
 158     );


Above change allows you to access $ScripObj in templates. See
lib/RT/Action/Notify.pm to understand how recipients are storred in
the object.

Note that template itself can add recipients. Also, note that
RemoveInappropriateRecipients and other filters that may drop
recipients or delay delivery are called later. So information you add
to an email may mismatch reality.

> Thanks,
>
> Brent
>
>
> --------
> RT Training Sessions (http://bestpractical.com/services/training.html)
> * Boston — March 5 & 6, 2012



-- 
Best regards, Ruslan.



More information about the rt-users mailing list