Guest User

Untitled

a guest
Apr 11th, 2016
68
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2.  
  3.   <head></head>
  4.  
  5.   <body style="margin:0px; padding:0px; border: 0 none; font-size: 9px; font-family: verdana, sans-serif; background-color: #efefef;">
  6.  
  7.     <table style="width: 750px; margin: 50px auto 50px auto; border: 1px #ccc solid; background: #fff; font-size: 11px; font-family: verdana, sans-serif;" align="center">
  8.  
  9.       <tbody>
  10.  
  11.         <tr> <!-- Header Begin -->
  12.           <td colspan="2" style="word-wrap: break-word; border:0px;padding: 0px; color: #fff; background: #070075;">
  13.             <img alt="Company Support" src="https://www.company.com/header2.png" width="750">
  14.             <!-- if end user put emergencies or after hours: phone number -->
  15.           </td>
  16.         </tr><!-- Header End -->
  17.  
  18.         <tr style="padding: 10px;"> <!-- Main Body Begin -->
  19.           <td style="width:75%; padding: 15px 0px 15px 15px; vertical-align: top;"> <!-- Left Half Begin -->
  20.             <!-- <p style="margin-bottom: 10px;">{{recipient.full_name}},</p> -->
  21.  
  22.             {% case event %}
  23.  
  24.           {% when 'ticket-opened' %}
  25.  
  26.             {% case recipient.role %} {% when 'end_user' or 'reporting' %}
  27.             <p style="font-style: italic;margin-bottom:12px;">A new ticket has been opened.</p>
  28.  
  29.           {% when 'admin' or 'helpdesk_admin' %}
  30.  
  31.             {% if ticket.priority == 'High' %}
  32.               <p style="font-style: italic;margin-bottom:10px; color: red;">A new <b>HIGH PRIORITY</b> ticket has been opened.</p>
  33.             {% endif %}
  34.  
  35.             {% if ticket.priority == 'Med' %}
  36.               <p style="font-style: italic;margin-bottom:10px;">A new ticket has been opened.</p>
  37.             {% endif %}
  38.  
  39.             {% if ticket.priority == 'Low' %}
  40.               <p style="font-style: italic;margin-bottom:10px; color: green;">A new <b>Low Priority</b> ticket has been opened.</p>
  41.             {% endif %}
  42.  
  43.             {% endcase %}
  44.  
  45.           {% when 'ticket-assigned' %}
  46.  
  47.             {% case recipient.role %}
  48.  
  49.           {% when 'end_user' or 'reporting' %}
  50.  
  51.             {% if ticket.assignee.full_name_or_email == null %}
  52.               <p style="font-style: italic;margin-bottom:10px;">On {{ticket.last_comment.created_at | date_sw}},</p>
  53.               <p style="font-style: italic;margin-bottom:10px;">Ticket #{{ticket.id}} was unassigned.</p>
  54.             {% else %}
  55.               <p style="font-style: italic;margin-bottom:10px;">On {{ticket.last_comment.created_at | date_sw}},</p>
  56.               <p style="font-style: italic;margin-bottom:10px;">Ticket #{{ticket.id}} was assigned to <strong>{{ticket.assignee.full_name_or_email}}</strong>.</p>
  57.             {% endif %}
  58.  
  59.             {% if events contains 'ticket-comment' %}
  60.               <p style="margin-bottom: 10px;">{{ticket.last_comment.body | escape | simple_format}}</p>
  61.             {% endif %}
  62.  
  63.             {% when 'admin' or 'helpdesk_admin' %}
  64.               <p style="font-style: italic;margin-bottom:12px; color:red;">Ticket has been assigned to<strong> {{ticket.assignee.full_name_or_email}}</strong> by <strong>{{ticket.last_comment.creator.full_name_or_email}}</strong>.</p>
  65.             {% if events contains 'ticket-comment' %}
  66.               <p style="font-style: italic;margin-bottom:10px;">With the comment:</p>
  67.               <p style="margin-bottom: 10px;">{{ticket.last_comment.body | escape | simple_format}}</p>
  68.             {% endif %}
  69.  
  70.             {% endcase %}
  71.  
  72.           {% when 'ticket-comment' %}
  73.  
  74.             <p style="font-style: italic;margin-bottom:10px;">On {{ticket.last_comment.created_at | date_sw }},
  75.             <strong>{{ticket.last_comment.creator.full_name_or_email}}</strong> wrote:</p>
  76.             {{ticket.last_comment.body | escape | simple_format}}
  77.  
  78.           {%when 'ticket-closed', 'ticket-closed-dup' %}
  79.  
  80.             {% case recipient.role %}
  81.  
  82.           {% when 'end_user' or 'reporting' %}
  83.  
  84.             {% if events contains 'ticket-closed-dup' %}
  85.             <p>This ticket was closed as a duplicate of <a href="{{ticket.master_ticket_url | escape}}">Ticket #{{ticket.master_ticket}}</a>.</p>
  86.             {% else %}
  87.             <p style="font-style: italic;margin-bottom:10px;">On {{ticket.closed_at | date_sw}},</p>
  88.             <p style="font-style: italic;margin-bottom:10px;"><strong>Ticket #{{ticket.id}} was closed.</strong></p>
  89.             {% endif %}
  90.  
  91.             <p style="font-style: italic;margin-bottom:10px;">With the comment:</p>
  92.             <p style="margin-bottom: 10px;">{{ticket.last_comment.body | escape | simple_format}}</p>
  93.  
  94.             <p style="font-style: italic;margin-bottom:10px;">Please do not reply to this email unless this ticket has not been closed to your satisfaction. If you would like to thank<strong> {{ticket.assignee.full_name_or_email}}</strong>, use the email link to the right.</p>
  95.  
  96.             <!-- ************************************************************************** -->
  97.             <!-- The code below allows you to enter information that only the ticket creator will see when the ticket is closed. -->
  98.             <!-- This can be used to include a link to a survey form. Just remove the comment tags and replace text.-->
  99.             <!--
  100.            {% if recipient.email == ticket.creator.email %}
  101.            <p style="font-style: italic;margin-bottom:10px;">This email is to the creator of this ticket.</p>
  102.            {% endif %}
  103.            -->
  104.             <!-- ************************************************************************** -->
  105.  
  106.           {% when 'admin' or 'helpdesk_admin' %}
  107.  
  108.             {% if events contains 'ticket-closed-dup' %}
  109.             <p>This ticket was closed as a duplicate of <a href="{{ticket.master_ticket_portal_url | escape}}">Ticket #{{ticket.master_ticket}}</a>.</p>
  110.             {% else %}
  111.             <p style="font-style: italic;margin-bottom:10px;">On {{ticket.closed_at | date_sw}},</p>
  112.             <p style="font-style: italic;margin-bottom:10px;"><strong>Ticket #{{ticket.id}} was closed.</strong></p>
  113.             {% endif %}
  114.  
  115.             <p style="font-style: italic;margin-bottom:10px;">With the comment:</p>
  116.             <p style="margin-bottom: 10px;">{{ticket.last_comment.body | escape | simple_format}}</p>
  117.  
  118.  
  119.             {% endcase %}
  120.  
  121.           {% when 'ticket-reopened' %}
  122.  
  123.             {% case recipient.role %}
  124.  
  125.           {% when 'end_user' or 'reporting' %}
  126.  
  127.             <p style="font-style: italic;margin-bottom:10px;"><strong>Ticket #{{ticket.id}} has been reopened.</strong></p>
  128.  
  129.             {% if events contains 'ticket-comment' %}
  130.               <p style="font-style: italic;margin-bottom:10px;">With the comment:</p>
  131.               <p style="margin-bottom: 10px;">{{ticket.last_comment.body | escape | simple_format}}</p>
  132.             {% endif %}
  133.  
  134.             <p style="font-style: italic;margin-bottom:10px;">If this ticket has been re-opened in error, please click on the
  135.             Ticket URL in the box to the right to close it</p>
  136.  
  137.             {% when 'admin' or 'helpdesk_admin' %}
  138.  
  139.             <p style="font-style: italic;margin-bottom:10px;"><strong>Ticket #{{ticket.id}} has been reopened.</strong></p>
  140.  
  141.             {% if events contains 'ticket-comment' %}
  142.  
  143.             <p style="font-style: italic;margin-bottom:10px;">With the comment:</p>
  144.  
  145.             <p style="margin-bottom: 10px;">{{ticket.last_comment.body | escape | simple_format}}</p>
  146.  
  147.             {% endif %}
  148.             {% endcase %}
  149.  
  150.             {% endcase %}
  151.  
  152.             {% case recipient.role %}
  153.  
  154.           {% when 'admin' or 'helpdesk_admin' %}
  155.  
  156.             {% if ticket.priority == 'High' %} <!-- Top Box Begin -->
  157.             <table style="width: 540px; table-layout: fixed; border: 1px red solid; background: #ff9999; font-size: 11px; font-family: verdana, sans-serif;">
  158.             {% endif %}
  159.  
  160.             {% if ticket.priority == 'Med' %}
  161.             <table style="width: 540px; table-layout: fixed; border: 1px #999 solid; background: #ccc; font-size: 11px; font-family: verdana, sans-serif;">
  162.             {% endif %}
  163.  
  164.             {% if ticket.priority == 'Low' %} <!-- Top Box Begin -->
  165.             <table style="width: 540px; table-layout: fixed; border: 1px green solid; background: #ccffb3; font-size: 11px; font-family: verdana, sans-serif;">
  166.             {% endif %}
  167.  
  168.           {% when 'end_user' or 'reporting' %}
  169.  
  170.             <table style="width: 540px; table-layout: fixed; border: 1px #999 solid; background: #b3b3b3; font-size: 11px; font-family: verdana, sans-serif;">
  171.             {% endcase %}
  172.               <tr>
  173.                 <td word-wrap: break-word;>
  174.                   <div style="margin: 9px;">
  175.                     <h2 style="margin-bottom:5px; margin-top:10px; font-size:12px;">TICKET #{{ticket.id}}</h2>
  176.                     <p style="margin-bottom: 10px;"><strong>Summary:</strong> {{ticket.summary | escape}}</p>
  177.                     <p style="margin-bottom: 10px;"><strong>Description:</strong></p>{{ticket.body | escape | simple_format}}
  178.                   </div>
  179.                 </td>
  180.               </tr>
  181.             </table>  <!-- Top Box End -->
  182.  
  183.             <!-- ************************************************************************** -->
  184.             {% case event %}
  185.             <!-- ************************************************************************** -->
  186.             {% when 'ticket-opened' %}
  187.             <!-- If you have specific items that you want to display in certain circumstances, -->
  188.             <!-- prior to the ticket summary.  I wanted a summary on each email that went out -->
  189.  
  190.             <!-- ************************************************************************** -->
  191.             {% when 'ticket-assigned' %}
  192.             <!-- ************************************************************************** -->
  193.             {% when 'ticket-comment' %}
  194.             <!-- ************************************************************************** -->
  195.             {% when 'ticket-closed' %}
  196.             <!-- ************************************************************************** -->
  197.             {% when 'ticket-reopened' %}
  198.             <!-- ************************************************************************** -->
  199.             {% endcase %}
  200.             <!-- ************************************************************************** -->
  201.             <br />
  202.  
  203.             {% if ticket.previous_comments != empty %}
  204.  
  205.               <table style="width: 540px; table-layout: fixed; border: 1px #ccc solid; background: #eee; font-size: 11px; font-family: verdana, sans-serif;"> <!-- Bottom Box Begin -->
  206.                 <tr>
  207.                   <td word-wrap: break-word;>
  208.                     <div style="margin: 9px;">
  209.                       <h2 style="margin-bottom:5px; margin-top:10px; font-size:12px;">Ticket History</h2>
  210.  
  211.                       {% for comment in ticket.previous_comments %}
  212.  
  213.                         <hr />
  214.  
  215.                         <p style="margin-bottom:10px; margin-top:2px; font-style: italic; font-weight: bold; color: #606060;">On {{comment.created_at | date_sw }} {{comment.creator.full_name_or_email}} wrote:</p>
  216.                         {% if comment.is_note %}<div style="color: RED;">
  217.                           {{comment.body | escape | simple_format}}</div>
  218.                         {% else %}
  219.                           {{comment.body | escape | simple_format}}
  220.                         {% endif %}
  221.                       {% endfor %}
  222.  
  223.                     </div>
  224.                   </td>
  225.                 </tr>
  226.               </table> <!-- Bottom Box Begin -->
  227.  
  228.             {% endif %}
  229.  
  230.             <br />
  231.             <br />
  232.           </td> <!-- Left Half End -->
  233.  
  234.           <td style="width: 30%; vertical-align: top;"> <!-- Right Half Begin -->
  235.             <div style="align: right; padding: 8px; border: 1px #ccc solid; font-size: 10px;">
  236.               <strong>TICKET #</strong>{{ticket.id}}
  237.               <hr style="height: 1px; color: #ccc;" />
  238.               <strong>Date:</strong> {{ticket.created_at | date_sw}}<br />
  239.               <br />
  240.               <strong>Creator:</strong> <a style="color:#FF6600; text-decoration: none;" href=
  241.              "mailto:{{ticket.creator.email}}?subject={{ticket.ref}} {{ticket.summary}}">{{ticket.creator.full_name_or_email}}</a><br />
  242.               <strong>Department:</strong> {{ticket.creator.department}}<br>
  243.               <strong>Office Phone:</strong> {{ticket.creator.office_phone}}<br>
  244.               <strong>Cell Phone:</strong> {{ticket.creator.cell_phone}}<br>
  245.               <br />
  246.               <strong>Assignee:</strong> <a style="color:#FF6600; text-decoration: none;" href=
  247.              "mailto:{{ticket.assignee.email}}?subject={{ticket.ref}} {{ticket.summary}}">{{ticket.assignee.full_name_or_email}}</a><br />
  248.               <strong>Department:</strong> {{ticket.assignee.department}}<br>
  249.               <strong>Office Phone:</strong> {{ticket.assignee.office_phone}}<br>
  250.               <strong>Cell Phone:</strong> {{ticket.assignee.cell_phone}}<br><br />            
  251.               <strong>CC:</strong> <!--Begin CC name list loop-->
  252.               {% for user in ticket.users%}
  253.  
  254.                 {% if user.full_name_or_email != ticket.assignee.full_name_or_email and user.full_name_or_email != ticket.creator.full_name_or_email %}
  255.  
  256.                   {% if forloop.last %}
  257.                   <a style="color:#FF6600; text-decoration: none;" href="mailto:{{user.email}}?subject={{ticket.ref}} {{ticket.summary}}">{{user.full_name}}</a>
  258.                   {% else %}
  259.                   <a style="color:#FF6600; text-decoration: none;" href="mailto:{{user.email}}?subject={{ticket.ref}} {{ticket.summary}}">{{user.full_name}}</a>,
  260.                   {% endif %}
  261.  
  262.                 {% endif %}
  263.  
  264.               {% endfor %}
  265.  
  266.               <br/>
  267.               <br /> <!--End CC name list loop-->
  268.               <strong>Priority:</strong> {{ticket.priority}}<br />
  269.               <br />
  270.  
  271.               {% if recipient.role == 'admin' or recipient.role == 'helpdesk_admin' %}
  272.                 <strong>Category:</strong> {{ticket.category}}<br /><br />
  273.                 <strong>Related to:</strong> {{ticket.related_to}}<br />
  274.               {% endif %}
  275.  
  276.               <hr style="height: 1px; color: #ccc;" />
  277.  
  278.               <p style="margin-top:5px;">If you have any additional information regarding
  279.               this ticket respond to this email. Please remember to keep
  280.               <strong>{{ticket.ref}}</strong> in the email subject. You can also log into
  281.               the Help Desk system <a style="color:#FF6600; text-decoration: none;" href=
  282.              "https://helpdesk.company.com/portal">
  283.               here</a> to post a comment and view other tickets.</p>
  284.             </div>
  285.           </td> <!-- Right Half End -->
  286.         </tr> <!-- Main Body End -->
  287.  
  288.       </tbody>
  289.  
  290.     </table>
  291.  
  292.   </body>
  293.  
  294. </html>
RAW Paste Data