Send an e-mail message to one or more recipients for each row returned in the specified SQL query. The recipient(s) can be any combination of e-mail addresses, Enable user logins, or Enable Groups. If the query returns 0 rows, then no e-mails will be generated.
Inputs
- sql_query - Defines the SQL query to execute against the Enable database. Work item properties can be referenced by surrounding them with percent signs. NOTE: To use percent signs in the actual SQL query (e.g., wildcard in LIKE statement), precede each with a backslash character. For example: WHERE myColumn LIKE '\%something\%'. If referencing a work item property and the value may contain single quotes, surround the property reference with curly braces to ensure any single quotes are escaped. For example: WHERE myColumn LIKE '{%myProperty%}'. The curly braces must be inside the single quotes AND the property value cannot have any curly braces itself.
- email_from - Optional from address. If empty, global default will be used.
- email_to - Comma-delimited list of any combination of e-mail addresses, Enable user logins, or Enable Group names. Keywords surrounded by percent signs will be translated into the corresponding work item property values. Keywords surrounded by double-pipe characters will be translated into the named query result column.
- email_subject - Subject line for e-mail. Keywords surrounded by percent signs will be translated into the corresponding work item property values. Keywords surrounded by double-pipe characters will be translated into the named query result column.
- email_body - Body text for e-mail. Keywords surrounded by percent signs will be translated into the corresponding work item property values. Keywords surrounded by double-pipe characters will be translated into the named query result column.
- email_attachment - Fully-qualified path to file to be attached to the e-mail message. Keywords surrounded by percent signs will be translated into the corresponding work item property values. Keywords surrounded by double-pipe characters will be translated into the named query result column.
- batchSize - Number of records to process before delaying. A value of zero (or blank) means no batch dely will be applied.
- batchDelayMinutes - Number of minutes to delay processing after each batch has been processed.
Outputs
- email_send_status - Results of e-mail query send operation. SUCCESS if there were no errors, even if no e-mails were generated due to the query returning no rows. FAIL if there were any errors with executing the SQL or sending any e-mails.
- email_send_message - Detailed error message if email.send.status is FAIL
- sql_num_rows - Number of rows returned by the SQL query
- email_send_count - Number of e-mail messages sent successfully.
- email_fail_count - Number of e-mail messages that failed to be sent.