This section describes how the Task Notification email works, when you use this option in the User Task step.
Figure 3: Workflow: Task Notification (Click to enlarge image)
- A workflow instance starts.
- When a Task event with task notifications enabled is reached, the Workflow Event Execution executes the relevant method in the Workflow Shapes Library.
- The Workflow Shapes library executes the relevant method to the EventBusClient API, and the data is inserted from the task notification into the [EventBus][CustomEventInstance] and [EventBus][EventPolicyMappingInstance] tables in the K2 database. The data includes the body of the mail, subject, and so forth.
- Once the data has been added to the K2 database, the Workflow Event Execution goes into a waiting state, where it waits for the user to action the task.
- The EventBus Hosted Service checks the [EventBus][CustomEventInstance] and [EventBus][EventPolicyMappingInstance] tables in the K2 database every thirty seconds for new mail entries.
- When new mail entries are identified and retrieved, the EventBus Hosted Service executes the relevant method in the MessageBus Service.
- The connection strings are checked to determine whether EWS or SMTP is configured.
- Depending on whether you are using EWS or SMTP, the relevant K2 Library (K2 IMAP or K2 EWS) executes.
- If EWS, the K2 EWS Library makes a web service call to the Mail Server to send the email.
- If SMTP, the K2 IMAP Library makes a connection over TCP Port 25 to the Mail Server to send the email.
Changing the Provider
You can change the Provider in the ConnectionStringEditor.exe ([K2 Installation Directory]\K2\Host Server\Bin\ConnectionStringEditor.exe) tool.
Changing the From Address
You can change the From Address by editing the Connection String in the ConnectionStringEditor.exe ([K2 Installation Directory]\K2\Host Server\Bin\ConnectionStringEditor.exe) tool, editing the sendmailfrom value in the K2HostServer.exe.config file, and by editing the From Address value in the Environment Library node in K2 Management.
The mail account added as the new From Address requires specific K2 Service and Exchange permissions and rights. See the Required Permissions topic for more information.
If you change the From address, ensure that the K2 service account has permission to send email on that address's behalf. This is typically done by granting Delegate Rights for the K2 service account to send the email on behalf of the other email address. For more information on Delegate Rights see the Allow someone else to manage your mail and calendar article from the Microsoft Office support site. If you use an alternate From email, note that SmartActions will not function since reply emails are sent to the alternate From email and not to the one configured for SmartActions.