How to Send an Email From a Process
This tutorial shows you how to configure a service task to send an email from a business process application, and then how to deploy and test that application.
You should work through each section in turn to complete the tutorial.
Data fields can be used to dynamically set parts of the email at runtime (for example, the recipient, or part of the body text of the email).
A connection to an SMTP mail server must be configured, using a BPM runtime SMTP resource instance. At runtime, when the service task is executed, the BPM runtime constructs the email from the data provided in the send task and sends the email to the SMTP mail server, which in turn sends it to the specified recipients.
Prerequisites
You should be familiar with the basics of designing, implementing and deploying process-based applications using TIBCO Business Studio. If you are not familiar with these things, you should run through the following tutorials before attempting this one:
- How to Design a Simple WelcomeUsers Business Service
- How to Implement and Deploy the WelcomeUsers Application
Before You Begin
You will need to know the SMTP address and port number used by your SMTP mail server to be able to test and run this tutorial.
- Importing the AcknowledgeClaim Analysis Project
To avoid having to build the process from scratch and focus just on the steps involved in sending an email from a process, this tutorial provides a "work in progress" project as a starting point. - Creating an Email Service Task
To send an email from a process you use a Service task of type Email. - Setting up Dynamic Data Inputs to the Email
Data fields defined in the process can be used to dynamically set parts of the email at runtime - for example, the recipient, part of the body text of the email, or the contents of attachments. - Populating the Data Fields
Data fields used as tokens on an email task must be populated before the email task is processed. - Setting Up a System Participant
When you set the Service Type for the service task to E-Mail, TIBCO Business Studio automatically creates a system participant and assigns it to the service task. - Creating an SMTP Resource Instance
An SMTP resource instance must exist in the BPM runtime before you can deploy the AcknowledgeClaim application. This resource instance defines the connection information used by the BPM runtime to contact the SMTP mail server. - Deploying the Application
As part of the deployment process, you map the system participant used by the email service task to the SMTP resource instance you created earlier. - Testing the Application
You can now test the application by running an instance of it in Workspace and checking your email.