Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.68 KB | None | 0 0
  1. /********************************************************************************
  2. Copyright 2016 Lexmark International, Inc. All Rights Reserved.
  3. Reproduction and distribution of the contents of this work are prohibited without express and prior
  4. written consent of Lexmark International. Use of this work without an active iScript license is prohibited.
  5.  
  6. Name: SendEmailWorkflow.js
  7. Author: Lexmark International, Inc
  8. Created: 02/12/2014-RG
  9. Last Updated: 02/15/2017-JJM
  10. For Version: 6.x, 7.x
  11. Script Version: $Id$
  12. ---------------------------------------------------------------------------------
  13. ********************************************************************************/
  14.  
  15. // Where to route the document to if there is no matching queue in configuration. Leave blank to disable.
  16. var ERROR_QUEUE = "Notification Error";
  17.  
  18. var EMAIL_CONFIG =
  19. {
  20. /*
  21. "current queue item is in" :
  22. {
  23. queueSuccess :
  24. Leave blank if no success queue is desired.
  25. If you want the Perceptive Content workflow item to move to another queue in the workflow process,
  26. enter the name of the queue after an email is sent successfully.
  27. queueError :
  28. (leave blank if no error queue is desired)
  29. If you want the Perceptive Content workflow item to move to an error queue in the workflow process,
  30. enter the name of the error queue if the email was not sent.
  31.  
  32. emailSplit (true/false) :
  33. Should each TO email address be sent as a separate email instead of grouping all of the TO email addresses
  34. together into one email. Keep in mind, if grouped, each person receiving the email via the TO email address
  35. can see who else the email has been sent to.
  36.  
  37. emailConfig :
  38. {
  39. Note: All of the following parameters match the iEmail configuration. Please refer to the iEmail STL function
  40. header for additional details.
  41.  
  42. IsHTML (true/false):
  43. If the body of the email contains HTML code. Will need to set useUtility to true if this is true.
  44. useUtility (true/false):
  45. If the email should be sent with ASPEmail instead. Make sure it is installed if using this options.
  46. useCDO (true/false):
  47. Send email using the CDO Message Object
  48. smtp :
  49. The name of the SMTP email service.
  50. from :
  51. You can either specify a static string literal or use the following
  52. configuration for getting the FROM email address(es) for the email.
  53. {
  54. type:
  55. LITERAL : Literal value
  56. DOCUMENT_PROPERTY : Document property
  57. CUSTOM_PROPERTY : Custom property
  58. QUEUE : Retrieve emails from users on queue.
  59. source: Name of property to retrieve. If type is QUEUE, name of queue to get emails from.
  60. func: Name of function to massage data if needed, else false.
  61. },
  62.  
  63. Note: This can also be an array of values that will get concenated together by a comma.
  64. For example, [{type: "LITERAL", source: "test@test.com", func: ""},{type: "LITERAL", source: "test2@test2.com", func: ""}]
  65. would output the following: "test@test.com,test2@test2.com"
  66. to :
  67. You can either specify a static string literal or use the following
  68. configuration for getting the TO email address(es) for the email.
  69. [
  70. type:
  71. LITERAL : Literal value
  72. DOCUMENT_PROPERTY : Document property
  73. CUSTOM_PROPERTY : Custom property
  74. QUEUE : Retrieve emails from users on queue.
  75. source: Name of property to retrieve. If type is QUEUE, name of queue to get emails from.
  76. func: Name of function to massage data if needed, else false.
  77. ],
  78.  
  79. Note: This can also be an array of values that will get concenated together by a comma.
  80. For example, [{type: "LITERAL", source: "test@test.com", func: ""},{type: "LITERAL", source: "test2@test2.com", func: ""}]
  81. would output the following: "test@test.com,test2@test2.com"
  82. cc :
  83. You can either specify a static string literal or use the following
  84. configuration for getting the CC email address(es) for the email.
  85. [
  86. type:
  87. LITERAL : Literal value
  88. DOCUMENT_PROPERTY : Document property
  89. CUSTOM_PROPERTY : Custom property
  90. QUEUE : Retrieve emails from users on queue.
  91. source: Name of property to retrieve. If type is QUEUE, name of queue to get emails from.
  92. func: Name of function to massage data if needed, else false.
  93. ],
  94.  
  95. Note: This can also be an array of values that will get concenated together by a comma.
  96. For example, [{type: "LITERAL", source: "test@test.com", func: ""},{type: "LITERAL", source: "test2@test2.com", func: ""}]
  97. would output the following: "test@test.com,test2@test2.com"
  98. bcc :
  99. You can either specify a static string literal or use the following
  100. configuration for getting the BCC email address(es) for the email.
  101. [
  102. type:
  103. LITERAL : Literal value
  104. DOCUMENT_PROPERTY : Document property
  105. CUSTOM_PROPERTY : Custom property
  106. QUEUE : Retrieve emails from users on queue.
  107. source: Name of property to retrieve. If type is QUEUE, name of queue to get emails from.
  108. func: Name of function to massage data if needed, else false.
  109. ],
  110.  
  111. Note: This can also be an array of values that will get concenated together by a comma.
  112. For example, [{type: "LITERAL", source: "test@test.com", func: ""},{type: "LITERAL", source: "test2@test2.com", func: ""}]
  113. would output the following: "test@test.com,test2@test2.com"
  114. subject :
  115. Text of subject
  116. body :
  117. Text of body
  118. },
  119. emailTextToReplace :
  120. Note: This is mainly used to replace values in the subject and body of the email.
  121. [
  122. "pattern to replace in any of the emailConfig parameters" :
  123. {
  124. type:
  125. LITERAL : Literal value
  126. OBJECT_PROPERTY : Document property
  127. CUSTOM_PROPERTY : Custom property
  128. DICTIONARY : Non-line item form node
  129. source: Name of property to retrieve. If type is QUEUE, name of queue to get emails from.
  130. If type is DICTIONARY, the full XML path to the item is required.
  131. func: Name of function to massage data if needed, else false.
  132. }
  133. ]
  134.  
  135. formName: Name of form if using form data, else "" or false
  136.  
  137. attachmentPageNum (string): Set to "NONE" for no pages, Set to "ALL" for all pages, "LAST" for last page, or "number" of page you want to attach.
  138. attachmentTempDir (string): Temporary place to store attachments while preparing the email. Files will be deleted afterwards.
  139. }
  140. */
  141. "Queue Name" :
  142. {
  143. queueSuccess : "Success",
  144. queueError : "Error",
  145.  
  146. emailSplit : true,
  147. emailConfig :
  148. {
  149. IsHTML : false,
  150. useUtility : true, // if this is true, ASPEmail will need to be installed on the server running this script.
  151. useCDO : false,
  152. smtp : "mail.test.com",
  153. from : "DoNotReply@test.com",
  154. to :
  155. [
  156. { type:"LITERAL", source: "test@test.com", func:false },
  157. { type:"LITERAL", source: "test@test2.com", func:false },
  158. { type:"LITERAL", source: "test@test3.com", func:false },
  159. ],
  160. cc : "",
  161. bcc : "",
  162. subject : "Email sent from workflow",
  163. body : "The following email has been sent from workflow.\n\n"+
  164. "\t\tField1: <<field1>>\n\t\tField2: <<field2>>\n\t\tField3: <<field3>>\n"
  165. },
  166. emailTextToReplace :
  167. {
  168. "<<field1>>" : { type:"DOCUMENT_PROPERTY", source:"field1", func:false, required:false },
  169. "<<field2>>" : { type:"DOCUMENT_PROPERTY", source:"field2", func:false, required:false },
  170. "<<field3>>" : { type:"DOCUMENT_PROPERTY", source:"field3", func:false, required:false }
  171. },
  172.  
  173. formName : "",
  174.  
  175. attachmentPageNum : "ALL",
  176. attachmentTempDir : "e:\\inserver\\temp"
  177. },
  178. "Queue Name 2" :
  179. {
  180. queueSuccess : "Success 2",
  181. queueError : "Error 2",
  182.  
  183. emailSplit : true,
  184. emailConfig :
  185. {
  186. IsHTML : false,
  187. useUtility : true, // if this is true, ASPEmail will need to be installed on the server running this script.
  188. useCDO : false,
  189. smtp : "mail.test.com",
  190. from : "DoNotReply@test.com",
  191. to :
  192. [
  193. { type:"LITERAL", source: "test@test.com", func:false },
  194. { type:"LITERAL", source: "test@test2.com", func:false },
  195. { type:"LITERAL", source: "test@test3.com", func:false },
  196. ],
  197. cc : "",
  198. bcc : "",
  199. subject : "Email sent from workflow",
  200. body : "The following email has been sent from workflow.\n\n"+
  201. "\t\tField1: <<field1>>\n\t\tField2: <<field2>>\n\t\tField3: <<field3>>\n"
  202. },
  203. emailTextToReplace :
  204. {
  205. "<<field1>>" : { type:"DOCUMENT_PROPERTY", source:"field1", func:false, required:false },
  206. "<<field2>>" : { type:"DOCUMENT_PROPERTY", source:"field2", func:false, required:false },
  207. "<<field3>>" : { type:"DOCUMENT_PROPERTY", source:"field3", func:false, required:false }
  208. },
  209.  
  210. formName : "",
  211.  
  212. attachmentPageNum : "ALL",
  213. attachmentTempDir : "e:\\inserver\\temp"
  214. },
  215. };
  216. // Required Comment - DO NOT REMOVE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement