Create template to send emails

Hello.

I hope you are doing well.

I know where to create custom templates, but I do not know how can I load it.

Should be exist a dropdown menu to load the template? I am using root user.

The version of RT and RTIR is the latest, 5.0.3.

Regards

The templates are used by scrips, so once you’ve created your template, you’ll need to choose (or create) a scrip that uses it.

Hello GreenJimll,

Is there any approach to send emails with HTML templates via RTIR?

Thank you

Templates are used by scrips (Admin->Global->Scrips) that send emails, so you can make a new scrip that runs on some condition and sends to some recipients and then uses your new email template (Admin->Global->Templates)

Templates are the only way to send emails in HTML?

You could also probably call an external program if you wanted from a scrip

Hi @pedro.cunha

What is your goal? Do you want templates to choose a given text on correspondence to answer a ticket or do you want to send correspondence out as HTML-emails to use bold, italic and so on?

The first one is supported by ‘Articles’.

Edit: Next paragraphs statement is wrong
The second one is not supported out of the box. One have to alter the ‘ContentType’ and care about the tags by the writer. IMO there is no wysiwyg frontend to write a transaction in html.

Regards, Andre.

Hi @rubberduck

I was able to write an HTML template that is executed with the Script “Send Investigation/Countermeasure”

This is an example:

RT-Attach-Message: yes
Subject: {$Ticket->Subject}
Content-Type: text/html

<html>
<style>
body {{q{background-color: powderblue;}}}
h1   {{q{color: blue;}}}
p    {{q{color: red;}}}
</style>
<body>
   <b>Ticket ID:</b> {$Ticket->Id} <br>
   <b>Priority:</b> {$Ticket->PriorityAsString} <br>
   <b>Created:</b> {$Ticket->Created} <br>
   <b>Due:</b> {$Ticket->Due} <br>

   {$Transaction->Content(Type => 'text/html')}
</body>
</html>

I had to escape the CSS changing {}, like this:

<style>
body {background-color: powderblue;}
h1   {color: blue;}
p    {color: red;}
</style>

to

<style>
body {q{{background-color: powderblue;}}}
h1   {q{{color: blue;}}}
p    {q{{color: red;}}}
</style>

Thanks

Yes, one can use HTML in templates and scrips, like @knation mentioned.

I have to correct my statement. Users can write correspondance as HTML out of the box. At least with RT5, maybe before:

=item C<$MessageBoxRichText>

Should “rich text” editing be enabled? This option lets your users
send HTML email messages from the web interface.

=cut