Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /********************************************************************************
- Copyright 2016 Lexmark International, Inc. All Rights Reserved.
- Reproduction and distribution of the contents of this work are prohibited without express and prior
- written consent of Lexmark International. Use of this work without an active iScript license is prohibited.
- Name: SendEmailWorkflow.js
- Author: Lexmark International, Inc
- Created: 02/12/2014-RG
- Last Updated: 02/15/2017-JJM
- For Version: 6.x, 7.x
- Script Version: $Id$
- ---------------------------------------------------------------------------------
- ********************************************************************************/
- // Where to route the document to if there is no matching queue in configuration. Leave blank to disable.
- var ERROR_QUEUE = "Notification Error";
- var EMAIL_CONFIG =
- {
- /*
- "current queue item is in" :
- {
- queueSuccess :
- Leave blank if no success queue is desired.
- If you want the Perceptive Content workflow item to move to another queue in the workflow process,
- enter the name of the queue after an email is sent successfully.
- queueError :
- (leave blank if no error queue is desired)
- If you want the Perceptive Content workflow item to move to an error queue in the workflow process,
- enter the name of the error queue if the email was not sent.
- emailSplit (true/false) :
- Should each TO email address be sent as a separate email instead of grouping all of the TO email addresses
- together into one email. Keep in mind, if grouped, each person receiving the email via the TO email address
- can see who else the email has been sent to.
- emailConfig :
- {
- Note: All of the following parameters match the iEmail configuration. Please refer to the iEmail STL function
- header for additional details.
- IsHTML (true/false):
- If the body of the email contains HTML code. Will need to set useUtility to true if this is true.
- useUtility (true/false):
- If the email should be sent with ASPEmail instead. Make sure it is installed if using this options.
- useCDO (true/false):
- Send email using the CDO Message Object
- smtp :
- The name of the SMTP email service.
- from :
- You can either specify a static string literal or use the following
- configuration for getting the FROM email address(es) for the email.
- {
- type:
- LITERAL : Literal value
- DOCUMENT_PROPERTY : Document property
- CUSTOM_PROPERTY : Custom property
- QUEUE : Retrieve emails from users on queue.
- source: Name of property to retrieve. If type is QUEUE, name of queue to get emails from.
- func: Name of function to massage data if needed, else false.
- },
- Note: This can also be an array of values that will get concenated together by a comma.
- For example, [{type: "LITERAL", source: "test@test.com", func: ""},{type: "LITERAL", source: "test2@test2.com", func: ""}]
- would output the following: "test@test.com,test2@test2.com"
- to :
- You can either specify a static string literal or use the following
- configuration for getting the TO email address(es) for the email.
- [
- type:
- LITERAL : Literal value
- DOCUMENT_PROPERTY : Document property
- CUSTOM_PROPERTY : Custom property
- QUEUE : Retrieve emails from users on queue.
- source: Name of property to retrieve. If type is QUEUE, name of queue to get emails from.
- func: Name of function to massage data if needed, else false.
- ],
- Note: This can also be an array of values that will get concenated together by a comma.
- For example, [{type: "LITERAL", source: "test@test.com", func: ""},{type: "LITERAL", source: "test2@test2.com", func: ""}]
- would output the following: "test@test.com,test2@test2.com"
- cc :
- You can either specify a static string literal or use the following
- configuration for getting the CC email address(es) for the email.
- [
- type:
- LITERAL : Literal value
- DOCUMENT_PROPERTY : Document property
- CUSTOM_PROPERTY : Custom property
- QUEUE : Retrieve emails from users on queue.
- source: Name of property to retrieve. If type is QUEUE, name of queue to get emails from.
- func: Name of function to massage data if needed, else false.
- ],
- Note: This can also be an array of values that will get concenated together by a comma.
- For example, [{type: "LITERAL", source: "test@test.com", func: ""},{type: "LITERAL", source: "test2@test2.com", func: ""}]
- would output the following: "test@test.com,test2@test2.com"
- bcc :
- You can either specify a static string literal or use the following
- configuration for getting the BCC email address(es) for the email.
- [
- type:
- LITERAL : Literal value
- DOCUMENT_PROPERTY : Document property
- CUSTOM_PROPERTY : Custom property
- QUEUE : Retrieve emails from users on queue.
- source: Name of property to retrieve. If type is QUEUE, name of queue to get emails from.
- func: Name of function to massage data if needed, else false.
- ],
- Note: This can also be an array of values that will get concenated together by a comma.
- For example, [{type: "LITERAL", source: "test@test.com", func: ""},{type: "LITERAL", source: "test2@test2.com", func: ""}]
- would output the following: "test@test.com,test2@test2.com"
- subject :
- Text of subject
- body :
- Text of body
- },
- emailTextToReplace :
- Note: This is mainly used to replace values in the subject and body of the email.
- [
- "pattern to replace in any of the emailConfig parameters" :
- {
- type:
- LITERAL : Literal value
- OBJECT_PROPERTY : Document property
- CUSTOM_PROPERTY : Custom property
- DICTIONARY : Non-line item form node
- source: Name of property to retrieve. If type is QUEUE, name of queue to get emails from.
- If type is DICTIONARY, the full XML path to the item is required.
- func: Name of function to massage data if needed, else false.
- }
- ]
- formName: Name of form if using form data, else "" or false
- 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.
- attachmentTempDir (string): Temporary place to store attachments while preparing the email. Files will be deleted afterwards.
- }
- */
- "Queue Name" :
- {
- queueSuccess : "Success",
- queueError : "Error",
- emailSplit : true,
- emailConfig :
- {
- IsHTML : false,
- useUtility : true, // if this is true, ASPEmail will need to be installed on the server running this script.
- useCDO : false,
- smtp : "mail.test.com",
- from : "DoNotReply@test.com",
- to :
- [
- { type:"LITERAL", source: "test@test.com", func:false },
- { type:"LITERAL", source: "test@test2.com", func:false },
- { type:"LITERAL", source: "test@test3.com", func:false },
- ],
- cc : "",
- bcc : "",
- subject : "Email sent from workflow",
- body : "The following email has been sent from workflow.\n\n"+
- "\t\tField1: <<field1>>\n\t\tField2: <<field2>>\n\t\tField3: <<field3>>\n"
- },
- emailTextToReplace :
- {
- "<<field1>>" : { type:"DOCUMENT_PROPERTY", source:"field1", func:false, required:false },
- "<<field2>>" : { type:"DOCUMENT_PROPERTY", source:"field2", func:false, required:false },
- "<<field3>>" : { type:"DOCUMENT_PROPERTY", source:"field3", func:false, required:false }
- },
- formName : "",
- attachmentPageNum : "ALL",
- attachmentTempDir : "e:\\inserver\\temp"
- },
- "Queue Name 2" :
- {
- queueSuccess : "Success 2",
- queueError : "Error 2",
- emailSplit : true,
- emailConfig :
- {
- IsHTML : false,
- useUtility : true, // if this is true, ASPEmail will need to be installed on the server running this script.
- useCDO : false,
- smtp : "mail.test.com",
- from : "DoNotReply@test.com",
- to :
- [
- { type:"LITERAL", source: "test@test.com", func:false },
- { type:"LITERAL", source: "test@test2.com", func:false },
- { type:"LITERAL", source: "test@test3.com", func:false },
- ],
- cc : "",
- bcc : "",
- subject : "Email sent from workflow",
- body : "The following email has been sent from workflow.\n\n"+
- "\t\tField1: <<field1>>\n\t\tField2: <<field2>>\n\t\tField3: <<field3>>\n"
- },
- emailTextToReplace :
- {
- "<<field1>>" : { type:"DOCUMENT_PROPERTY", source:"field1", func:false, required:false },
- "<<field2>>" : { type:"DOCUMENT_PROPERTY", source:"field2", func:false, required:false },
- "<<field3>>" : { type:"DOCUMENT_PROPERTY", source:"field3", func:false, required:false }
- },
- formName : "",
- attachmentPageNum : "ALL",
- attachmentTempDir : "e:\\inserver\\temp"
- },
- };
- // Required Comment - DO NOT REMOVE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement