Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function runNotificationScript(
- /* SimpleRecord */ current,
- /* SimpleTemplatePrinter */ template,
- /* SimpleEmailOutbound */ email,
- /* SimpleRecord */ event
- ) {
- const pretensionRecordID = current.parent_id.sys_id;
- const pretension = new SimpleRecord('c_claim_task');
- pretension.get(pretensionRecordID);
- const url = ss.getProperty('itsm.notification.spacer_href');
- const defaultURL = 'https://s3-home.simpleone.ru/public-attachment/b/c7/bxfu7zjn6wxlgbncjpptahdph2ytw6u?response-content-disposition=inline%3B%20filename%3D%22spacer.gif%22&response-content-type=image%2Fgif%3B';
- const link = url || defaultURL;
- let urlLogo = ss.getProperty('itsm.notification.logo_href');
- const defaultURL_LOGO = 'https://s3-home.simpleone.ru/public-attachment/3/cc/o7fu4iswyazyoozyprlft98ioeoukffh?response-content-disposition=inline%3B%20filename%3D%22logo.png%22&response-content-type=image%2Fpng%3B';
- urlLogo = urlLogo || defaultURL_LOGO;
- const serviceDeskHref = ss.getProperty('itsm.notification.servicedesk_href') || '';
- const serviceDeskTitle = ss.getProperty('itsm.notification.servicedesk_title') || '';
- const contactPageHref = ss.getProperty('itsm.notification.contact.page_href') || '';
- const contactPageTitle = ss.getProperty('itsm.notification.contact.page_title') || '';
- const contactEmail = ss.getProperty('itsm.notification.contact.email') || '';
- const contactPhone = ss.getProperty('itsm.notification.contact.phone') || '';
- const sectionTopTask = `
- <!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title></title>
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <style type="text/css">/* Remove space around the email design. */
- html,
- body {
- margin: 0 auto !important;
- padding: 0 !important;
- height: 100% !important;
- width: 100% !important;
- }
- /* Stop Outlook resizing small text. */
- * {
- -ms-text-size-adjust: 100%;
- }
- /* Stop Outlook from adding extra spacing to tables. */
- table,
- td {
- mso-table-lspace: 0pt !important;
- mso-table-rspace: 0pt !important;
- }
- /* Use a better rendering method when resizing images in Outlook IE. */
- img {
- -ms-interpolation-mode: bicubic;
- }
- /* Prevent Windows 10 Mail from underlining links. Styles for underlined links should be inline. */
- a {
- text-decoration: none;
- }
- </style>
- </head>
- <body style="margin: 0px; padding: 0px; width: 100%; height: 100%; background: rgb(239, 242, 247); cursor: auto;">
- <table bgcolor="#eff2f7" border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
- <tbody>
- <tr>
- <td align="center" valign="top">
- <table border="0" cellpadding="0" cellspacing="0" width="100%">
- <tbody>
- <tr>
- <td height="20"> </td>
- </tr>
- <tr>
- <td align="center" valign="top">
- <table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" style="border: 1px solid #D5D8DD;background: #ffffff;border-radius: 4px;" width="600">
- <tbody>
- <tr>
- <td colspan="3" height="40"> </td>
- </tr>
- <tr>
- <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
- <td align="left"><a href="${link}" style="display: inline-block;outline: 0;" target="_blank"><img alt="Simpleone" border="0" height="20" src="${urlLogo}" style="display: block;" width="110" /> </a></td>
- <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
- </tr>
- <tr>
- <td colspan="3" height="32"> </td>
- </tr>
- <!--title-->
- <tr>
- <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
- <td align="left" style="font-family: Arial, sans-serif;font-weight: bold;font-size: 28px;line-height: 40px;color: #334D6E;">Задача по претензии</td>
- <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
- </tr>
- <tr>
- <td colspan="3" height="24"> </td>
- </tr>
- <tr>
- <td bgcolor="#DFE1E5" colspan="3" height="1" style="line-height: 0;font-size: 0;height:1px;background: #DFE1E5;"> </td>
- </tr>
- <tr>
- <td colspan="3" height="40"> </td>
- </tr>
- <!--text-->
- <tr>
- <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
- <td align="left" style="font-family: Arial, sans-serif;font-weight: bold;font-size: 20px;line-height: 20px;color: #0051bb;">Информация о задаче</td>
- <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
- </tr>
- <tr>
- <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
- <td align="left" style="font-family: Arial, sans-serif;font-weight: normal;font-size: 16px;line-height: 24px;color: #334D6E;"><!--/новая строка -->
- <table border="0" cellpadding="0" cellspacing="0">
- <tbody>
- <tr>
- <td height="16"> </td>
- </tr>
- </tbody>
- </table>
- <!--/мапинг--><font style="font-family: Arial, sans-serif;font-weight: bold;font-size: 16px;line-height: 16px;color: #334D6E;">Краткое описание</font><br />
- ${current.short_description} <!--/новая строка -->
- <table border="0" cellpadding="0" cellspacing="0">
- <tbody>
- <tr>
- <td height="16"> </td>
- </tr>
- </tbody>
- </table>
- <!--/мапинг--> <font style="font-family: Arial, sans-serif;font-weight: bold;font-size: 16px;line-height: 16px;color: #334D6E;"> Описание </font><br />
- ${current.c_clarification}<br />
- </td>
- <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
- </tr>
- `
- const sectionMidlePretension = `
- <tr>
- <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
- <td align="left" style="font-family: Arial, sans-serif;font-weight: bold;font-size: 20px;line-height: 20px;color: #0051bb;">Информация о претензии</td>
- <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
- </tr>
- <tr>
- <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
- <td align="left" style="font-family: Arial, sans-serif;font-weight: normal;font-size: 16px;line-height: 24px;color: #334D6E;"><!--/новая строка -->
- <table border="0" cellpadding="0" cellspacing="0">
- <tbody>
- <tr>
- <td height="16"> </td>
- </tr>
- </tbody>
- </table>
- <!--/мапинг--><font style="font-family: Arial, sans-serif;font-weight: bold;font-size: 16px;line-height: 16px;color: #334D6E;">Краткое описание</font><br />
- ${pretension.getDisplayValue('short_description')}
- <table border="0" cellpadding="0" cellspacing="0">
- <tbody>
- <tr>
- <td height="16"> </td>
- </tr>
- </tbody>
- </table>
- <!--/мапинг--> <font style="font-family: Arial, sans-serif;font-weight: bold;font-size: 16px;line-height: 16px;color: #334D6E;"> Описание </font><br />
- ${pretension.c_clarification}<br />
- <!--/новая строка -->
- <table border="0" cellpadding="0" cellspacing="0">
- <tbody>
- <tr>
- <td height="16"> </td>
- </tr>
- </tbody>
- </table>
- <!--/мапинг--> <font style="font-family: Arial, sans-serif;font-weight: bold;font-size: 16px;line-height: 16px;color: #334D6E;"> Тип </font><br />
- ${pretension.getDisplayValue('c_source_type')}<br />
- <!--/новая строка -->
- <table border="0" cellpadding="0" cellspacing="0">
- <tbody>
- <tr>
- <td height="16"> </td>
- </tr>
- </tbody>
- </table>
- <!--/мапинг--> <font style="font-family: Arial, sans-serif;font-weight: bold;font-size: 16px;line-height: 16px;color: #334D6E;"> Вид </font><br />
- ${pretension.getDisplayValue('c_type_claims')}<br />
- <!--/новая строка -->
- <table border="0" cellpadding="0" cellspacing="0">
- <tbody>
- <tr>
- <td height="16"> </td>
- </tr>
- </tbody>
- </table>
- <!--/мапинг--> <font style="font-family: Arial, sans-serif;font-weight: bold;font-size: 16px;line-height: 16px;color: #334D6E;"> Входящий номер </font><br />
- ${pretension.getDisplayValue('c_incoming_number')}<br />
- <!--/новая строка -->
- <table border="0" cellpadding="0" cellspacing="0">
- <tbody>
- <tr>
- <td height="16"> </td>
- </tr>
- </tbody>
- </table>
- <!--/мапинг--> <font style="font-family: Arial, sans-serif;font-weight: bold;font-size: 16px;line-height: 16px;color: #334D6E;"> Компания предъявитель</font><br />
- ${pretension.getDisplayValue('company')}<br />
- <!--/новая строка -->
- <table border="0" cellpadding="0" cellspacing="0">
- <tbody>
- <tr>
- <td height="16"> </td>
- </tr>
- </tbody>
- </table>
- <!--/мапинг--> <font style="font-family: Arial, sans-serif;font-weight: bold;font-size: 16px;line-height: 16px;color: #334D6E;"> Договор </font><br />
- ${pretension.getDisplayValue('c_agreement')}<br />
- <!--/новая строка -->
- <table border="0" cellpadding="0" cellspacing="0">
- <tbody>
- <tr>
- <td height="16"> </td>
- </tr>
- </tbody>
- </table>
- <!--/мапинг--> <font style="font-family: Arial, sans-serif;font-weight: bold;font-size: 16px;line-height: 16px;color: #334D6E;"> Регистрационный код </font><br />
- ${pretension.getDisplayValue('c_registration_code')}<br />
- <!--/новая строка -->
- <table border="0" cellpadding="0" cellspacing="0">
- <tbody>
- <tr>
- <td height="16"> </td>
- </tr>
- </tbody>
- </table>
- <!--/мапинг--> <font style="font-family: Arial, sans-serif;font-weight: bold;font-size: 16px;line-height: 16px;color: #334D6E;"> Сумма Претензии </font><br />
- ${pretension.getDisplayValue('c_claim_amount')}<br />
- </td>
- <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
- </tr>
- <!--text-->
- `
- const sectionBottomButtons = `
- <tr>
- <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
- <td align="left" style="font-family: Arial, sans-serif;font-weight: normal;font-size: 16px;line-height: 24px;color: #334D6E;">Для начала работы над задачей нажмите кнопку "Взять в работу". Чтобы подтвердить выполнение задачи нажмите кнопку "Завершить".</td>
- <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
- </tr>
- <tr>
- <td colspan="3" height="56"> </td>
- </tr>
- <!--button-->
- <tr>
- <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
- <td align="center">
- <table border="0" cellpadding="0" cellspacing="0">
- <tbody>
- <tr>
- <td style="padding-right: 12px;"><a href="#" style="display: inline-block;outline: 0;background:
- #00B24A;border-radius: 4px;color: #ffffff;font-size: 16px;line-height: 18px;font-family: Arial,
- sans-serif;text-decoration: none;overflow: hidden;padding-top: 16px;
- padding-bottom: 16px; width: 240px;mso-hide: all;font-weight: 700;text-align: center;" target="_blank">Взять в работу </a></td>
- <td style="padding-left: 12px;"><a href="#" style="display: inline-block;outline: 0;background:
- #E52600;border-radius: 4px;color: #ffffff;font-size: 16px;line-height: 18px;font-family: Arial,
- sans-serif;text-decoration: none;overflow: hidden;padding-top: 16px;
- padding-bottom: 16px; width: 226px;mso-hide: all;font-weight: 700;text-align: center;" target="_blank">Завершить </a></td>
- </tr>
- </tbody>
- </table>
- </td>
- <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
- </tr>
- <tr>
- <td colspan="3" height="56"> </td>
- </tr>
- <tr>
- <td height="1" style="line-height: 0;font-size: 0;height:1px;" width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
- <td bgcolor="#DFE1E5" height="1" style="line-height: 0;font-size: 0;height:1px;background: #DFE1E5"> </td>
- <td height="1" style="line-height: 0;font-size: 0;height:1px;" width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
- </tr>
- <tr>
- <td colspan="3" height="24"> </td>
- </tr>
- <!--footer-->
- <tr>
- <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
- <td align="left" style="font-family: Arial, sans-serif;font-weight: normal;font-size: 16px;line-height: 24px;color: #334D6E;">С уважением,<br />
- Служба поддержки клиентов <a href="${serviceDeskHref}" style="color: #0050C8;text-decoration: none;" target="_blank"><span style="color: #0050C8;">${serviceDeskTitle}</span></a></td>
- <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
- </tr>
- <tr>
- <td colspan="3" height="32"> </td>
- </tr>
- <tr>
- <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
- <td align="left" style="font-family: Arial, sans-serif;font-weight: normal;font-size: 12px;line-height: 14px;color: #334D6E;"><a href="${contactPageHref}" style="color: #0050C8;text-decoration: none;display: inline-block;" target="_blank"><span style="color: #0050C8;">${contactPageTitle}</span> </a> <span> </span> <a href="mailto:${contactEmail}" style="color: #0050C8;text-decoration: none;margin-left: 28px;display: inline-block;" target="_blank"> <span style="color: #0050C8;">${contactEmail}</span> </a> <span> </span> <span style="margin-left: 28px;display: inline-block;">${contactPhone}</span></td>
- <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
- </tr>
- <tr>
- <td colspan="3" height="40"> </td>
- </tr>
- </tbody>
- </table>
- </td>
- </tr>
- <tr>
- <td height="20"> </td>
- </tr>
- </tbody>
- </table>
- </td>
- </tr>
- </tbody>
- </table>
- </body>
- </html>
- `
- const retTemp = sectionTopTask + sectionMidlePretension + sectionBottomButtons
- email.setBody(retTemp)
- })(current, template, email, event);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement