Advertisement
Savelyev_Vyacheslav

Шаблорн письма

Sep 28th, 2023
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.94 KB | None | 0 0
  1. (function runNotificationScript(
  2. /* SimpleRecord */ current,
  3. /* SimpleTemplatePrinter */ template,
  4. /* SimpleEmailOutbound */ email,
  5. /* SimpleRecord */ event
  6. ) {
  7.  
  8. const pretensionRecordID = current.parent_id.sys_id;
  9. const pretension = new SimpleRecord('c_claim_task');
  10. pretension.get(pretensionRecordID);
  11.  
  12. const url = ss.getProperty('itsm.notification.spacer_href');
  13. 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';
  14. const link = url || defaultURL;
  15.  
  16. let urlLogo = ss.getProperty('itsm.notification.logo_href');
  17. 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';
  18. urlLogo = urlLogo || defaultURL_LOGO;
  19.  
  20. const serviceDeskHref = ss.getProperty('itsm.notification.servicedesk_href') || '';
  21.  
  22. const serviceDeskTitle = ss.getProperty('itsm.notification.servicedesk_title') || '';
  23.  
  24. const contactPageHref = ss.getProperty('itsm.notification.contact.page_href') || '';
  25.  
  26. const contactPageTitle = ss.getProperty('itsm.notification.contact.page_title') || '';
  27.  
  28. const contactEmail = ss.getProperty('itsm.notification.contact.email') || '';
  29.  
  30. const contactPhone = ss.getProperty('itsm.notification.contact.phone') || '';
  31.  
  32. const sectionTopTask = `
  33. <!DOCTYPE html
  34. PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  35. <html xmlns="http://www.w3.org/1999/xhtml">
  36. <head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  37. <title></title>
  38. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  39. <style type="text/css">/* Remove space around the email design. */
  40. html,
  41. body {
  42. margin: 0 auto !important;
  43. padding: 0 !important;
  44. height: 100% !important;
  45. width: 100% !important;
  46. }
  47.  
  48. /* Stop Outlook resizing small text. */
  49. * {
  50. -ms-text-size-adjust: 100%;
  51. }
  52.  
  53. /* Stop Outlook from adding extra spacing to tables. */
  54. table,
  55. td {
  56. mso-table-lspace: 0pt !important;
  57. mso-table-rspace: 0pt !important;
  58. }
  59.  
  60. /* Use a better rendering method when resizing images in Outlook IE. */
  61. img {
  62. -ms-interpolation-mode: bicubic;
  63. }
  64.  
  65. /* Prevent Windows 10 Mail from underlining links. Styles for underlined links should be inline. */
  66. a {
  67. text-decoration: none;
  68. }
  69. </style>
  70. </head>
  71. <body style="margin: 0px; padding: 0px; width: 100%; height: 100%; background: rgb(239, 242, 247); cursor: auto;">
  72. <table bgcolor="#eff2f7" border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
  73. <tbody>
  74. <tr>
  75. <td align="center" valign="top">
  76. <table border="0" cellpadding="0" cellspacing="0" width="100%">
  77. <tbody>
  78. <tr>
  79. <td height="20">&nbsp;</td>
  80. </tr>
  81. <tr>
  82. <td align="center" valign="top">
  83. <table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" style="border: 1px solid #D5D8DD;background: #ffffff;border-radius: 4px;" width="600">
  84. <tbody>
  85. <tr>
  86. <td colspan="3" height="40">&nbsp;</td>
  87. </tr>
  88. <tr>
  89. <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
  90. <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>
  91. <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
  92. </tr>
  93. <tr>
  94. <td colspan="3" height="32">&nbsp;</td>
  95. </tr>
  96. <!--title-->
  97. <tr>
  98. <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
  99. <td align="left" style="font-family: Arial, sans-serif;font-weight: bold;font-size: 28px;line-height: 40px;color: #334D6E;">Задача по претензии</td>
  100. <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
  101. </tr>
  102. <tr>
  103. <td colspan="3" height="24">&nbsp;</td>
  104. </tr>
  105. <tr>
  106. <td bgcolor="#DFE1E5" colspan="3" height="1" style="line-height: 0;font-size: 0;height:1px;background: #DFE1E5;">&nbsp;</td>
  107. </tr>
  108. <tr>
  109. <td colspan="3" height="40">&nbsp;</td>
  110. </tr>
  111. <!--text-->
  112. <tr>
  113. <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
  114. <td align="left" style="font-family: Arial, sans-serif;font-weight: bold;font-size: 20px;line-height: 20px;color: #0051bb;">Информация о задаче</td>
  115. <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
  116. </tr>
  117. <tr>
  118. <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
  119. <td align="left" style="font-family: Arial, sans-serif;font-weight: normal;font-size: 16px;line-height: 24px;color: #334D6E;"><!--/новая строка -->
  120. <table border="0" cellpadding="0" cellspacing="0">
  121. <tbody>
  122. <tr>
  123. <td height="16">&nbsp;</td>
  124. </tr>
  125. </tbody>
  126. </table>
  127. <!--/мапинг--><font style="font-family: Arial, sans-serif;font-weight: bold;font-size: 16px;line-height: 16px;color: #334D6E;">Краткое описание</font><br />
  128. ${current.short_description} <!--/новая строка -->
  129. <table border="0" cellpadding="0" cellspacing="0">
  130. <tbody>
  131. <tr>
  132. <td height="16">&nbsp;</td>
  133. </tr>
  134. </tbody>
  135. </table>
  136. <!--/мапинг--> <font style="font-family: Arial, sans-serif;font-weight: bold;font-size: 16px;line-height: 16px;color: #334D6E;"> Описание </font><br />
  137. ${current.c_clarification}<br />
  138. &nbsp;</td>
  139. <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
  140. </tr>
  141.  
  142. `
  143.  
  144.  
  145. const sectionMidlePretension = `
  146. <tr>
  147. <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
  148. <td align="left" style="font-family: Arial, sans-serif;font-weight: bold;font-size: 20px;line-height: 20px;color: #0051bb;">Информация о претензии</td>
  149. <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
  150. </tr>
  151. <tr>
  152. <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
  153. <td align="left" style="font-family: Arial, sans-serif;font-weight: normal;font-size: 16px;line-height: 24px;color: #334D6E;"><!--/новая строка -->
  154.  
  155.  
  156. <table border="0" cellpadding="0" cellspacing="0">
  157. <tbody>
  158. <tr>
  159. <td height="16">&nbsp;</td>
  160. </tr>
  161. </tbody>
  162. </table>
  163. <!--/мапинг--><font style="font-family: Arial, sans-serif;font-weight: bold;font-size: 16px;line-height: 16px;color: #334D6E;">Краткое описание</font><br />
  164. ${pretension.getDisplayValue('short_description')}
  165.  
  166.  
  167. <table border="0" cellpadding="0" cellspacing="0">
  168. <tbody>
  169. <tr>
  170. <td height="16">&nbsp;</td>
  171. </tr>
  172. </tbody>
  173. </table>
  174. <!--/мапинг--> <font style="font-family: Arial, sans-serif;font-weight: bold;font-size: 16px;line-height: 16px;color: #334D6E;"> Описание </font><br />
  175. ${pretension.c_clarification}<br />
  176.  
  177.  
  178. <!--/новая строка -->
  179. <table border="0" cellpadding="0" cellspacing="0">
  180. <tbody>
  181. <tr>
  182. <td height="16">&nbsp;</td>
  183. </tr>
  184. </tbody>
  185. </table>
  186. <!--/мапинг--> <font style="font-family: Arial, sans-serif;font-weight: bold;font-size: 16px;line-height: 16px;color: #334D6E;"> Тип </font><br />
  187. ${pretension.getDisplayValue('c_source_type')}<br />
  188. <!--/новая строка -->
  189. <table border="0" cellpadding="0" cellspacing="0">
  190. <tbody>
  191. <tr>
  192. <td height="16">&nbsp;</td>
  193. </tr>
  194. </tbody>
  195. </table>
  196. <!--/мапинг--> <font style="font-family: Arial, sans-serif;font-weight: bold;font-size: 16px;line-height: 16px;color: #334D6E;"> Вид </font><br />
  197. ${pretension.getDisplayValue('c_type_claims')}<br />
  198. <!--/новая строка -->
  199. <table border="0" cellpadding="0" cellspacing="0">
  200. <tbody>
  201. <tr>
  202. <td height="16">&nbsp;</td>
  203. </tr>
  204. </tbody>
  205. </table>
  206. <!--/мапинг--> <font style="font-family: Arial, sans-serif;font-weight: bold;font-size: 16px;line-height: 16px;color: #334D6E;"> Входящий номер </font><br />
  207. ${pretension.getDisplayValue('c_incoming_number')}<br />
  208. <!--/новая строка -->
  209. <table border="0" cellpadding="0" cellspacing="0">
  210. <tbody>
  211. <tr>
  212. <td height="16">&nbsp;</td>
  213. </tr>
  214. </tbody>
  215. </table>
  216. <!--/мапинг--> <font style="font-family: Arial, sans-serif;font-weight: bold;font-size: 16px;line-height: 16px;color: #334D6E;"> Компания предъявитель</font><br />
  217. ${pretension.getDisplayValue('company')}<br />
  218. <!--/новая строка -->
  219. <table border="0" cellpadding="0" cellspacing="0">
  220. <tbody>
  221. <tr>
  222. <td height="16">&nbsp;</td>
  223. </tr>
  224. </tbody>
  225. </table>
  226. <!--/мапинг--> <font style="font-family: Arial, sans-serif;font-weight: bold;font-size: 16px;line-height: 16px;color: #334D6E;"> Договор </font><br />
  227. ${pretension.getDisplayValue('c_agreement')}<br />
  228. <!--/новая строка -->
  229. <table border="0" cellpadding="0" cellspacing="0">
  230. <tbody>
  231. <tr>
  232. <td height="16">&nbsp;</td>
  233. </tr>
  234. </tbody>
  235. </table>
  236. <!--/мапинг--> <font style="font-family: Arial, sans-serif;font-weight: bold;font-size: 16px;line-height: 16px;color: #334D6E;"> Регистрационный код </font><br />
  237. ${pretension.getDisplayValue('c_registration_code')}<br />
  238. <!--/новая строка -->
  239. <table border="0" cellpadding="0" cellspacing="0">
  240. <tbody>
  241. <tr>
  242. <td height="16">&nbsp;</td>
  243. </tr>
  244. </tbody>
  245. </table>
  246. <!--/мапинг--> <font style="font-family: Arial, sans-serif;font-weight: bold;font-size: 16px;line-height: 16px;color: #334D6E;"> Сумма Претензии </font><br />
  247. ${pretension.getDisplayValue('c_claim_amount')}<br />
  248.  
  249.  
  250. &nbsp;</td>
  251. <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
  252. </tr>
  253. <!--text-->
  254. `
  255. const sectionBottomButtons = `
  256. <tr>
  257. <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
  258. <td align="left" style="font-family: Arial, sans-serif;font-weight: normal;font-size: 16px;line-height: 24px;color: #334D6E;">Для начала работы над задачей нажмите кнопку &quot;Взять в работу&quot;. Чтобы подтвердить выполнение задачи нажмите кнопку &quot;Завершить&quot;.</td>
  259. <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
  260. </tr>
  261. <tr>
  262. <td colspan="3" height="56">&nbsp;</td>
  263. </tr>
  264. <!--button-->
  265. <tr>
  266. <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
  267. <td align="center">
  268. <table border="0" cellpadding="0" cellspacing="0">
  269. <tbody>
  270. <tr>
  271. <td style="padding-right: 12px;"><a href="#" style="display: inline-block;outline: 0;background:
  272. #00B24A;border-radius: 4px;color: #ffffff;font-size: 16px;line-height: 18px;font-family: Arial,
  273. sans-serif;text-decoration: none;overflow: hidden;padding-top: 16px;
  274. padding-bottom: 16px; width: 240px;mso-hide: all;font-weight: 700;text-align: center;" target="_blank">Взять в работу </a></td>
  275. <td style="padding-left: 12px;"><a href="#" style="display: inline-block;outline: 0;background:
  276. #E52600;border-radius: 4px;color: #ffffff;font-size: 16px;line-height: 18px;font-family: Arial,
  277. sans-serif;text-decoration: none;overflow: hidden;padding-top: 16px;
  278. padding-bottom: 16px; width: 226px;mso-hide: all;font-weight: 700;text-align: center;" target="_blank">Завершить </a></td>
  279. </tr>
  280. </tbody>
  281. </table>
  282. </td>
  283. <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
  284. </tr>
  285. <tr>
  286. <td colspan="3" height="56">&nbsp;</td>
  287. </tr>
  288. <tr>
  289. <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>
  290. <td bgcolor="#DFE1E5" height="1" style="line-height: 0;font-size: 0;height:1px;background: #DFE1E5">&nbsp;</td>
  291. <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>
  292. </tr>
  293. <tr>
  294. <td colspan="3" height="24">&nbsp;</td>
  295. </tr>
  296. <!--footer-->
  297. <tr>
  298. <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
  299. <td align="left" style="font-family: Arial, sans-serif;font-weight: normal;font-size: 16px;line-height: 24px;color: #334D6E;">С уважением,<br />
  300. Служба поддержки клиентов <a href="${serviceDeskHref}" style="color: #0050C8;text-decoration: none;" target="_blank"><span style="color: #0050C8;">${serviceDeskTitle}</span></a></td>
  301. <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
  302. </tr>
  303. <tr>
  304. <td colspan="3" height="32">&nbsp;</td>
  305. </tr>
  306. <tr>
  307. <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
  308. <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>&nbsp;</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>&nbsp;</span> <span style="margin-left: 28px;display: inline-block;">${contactPhone}</span></td>
  309. <td width="40"><img height="1" src="${link}" style="display: block;outline: none;" width="40" /></td>
  310. </tr>
  311. <tr>
  312. <td colspan="3" height="40">&nbsp;</td>
  313. </tr>
  314. </tbody>
  315. </table>
  316. </td>
  317. </tr>
  318. <tr>
  319. <td height="20">&nbsp;</td>
  320. </tr>
  321. </tbody>
  322. </table>
  323. </td>
  324. </tr>
  325. </tbody>
  326. </table>
  327. </body>
  328. </html>
  329.  
  330. `
  331. const retTemp = sectionTopTask + sectionMidlePretension + sectionBottomButtons
  332.  
  333. email.setBody(retTemp)
  334.  
  335. })(current, template, email, event);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement