= Configure an email connector
:description: :experimental:

:experimental:

Bonita provides connectors for a process to interact with external systems, such as publishing a document on a CMS, calling a REST API, or sending an email. In this example we will configure an email connector, to send a notification to the manager that the task _Deal with unsatisfied customer_ requires their attention.

[NOTE]
====

A xref:connectors-overview.adoc[connector] is a piece of code that is executed when starting or finishing a process or a task. It will process input data (for example business variable values) and can also generate outputs. The connector code might only transform inputs, but it can also perform interaction with external systems.
====

To avoid settings that are specific to a real email provider, use a tool for a fake email server "FakeSMTP":

. Download FakeSMTP from this https://nilhcem.github.io/FakeSMTP/downloads/fakeSMTP-latest.zip
. Unzip the file
. Run FakeSMTP by double-clicking on the JAR file, or by running this shell command: `java -jar fakeSMTP-2.0.jar`
. When the user interface is displayed, set the *listening port* to _2525_
. Click on *Start server*
+
image:images/getting-started-tutorial/configure-email-connector/fakesmtp-configured-and-listening.png[FakeSMTP configured and listening]

Now that you have a fake email server running, configure the email connector on the _Deal with unsatisfied customer_ task:

. Select the task _Deal with unsatisfied customer_
. Go to menu:Execution[Connectors in]
. Click on *Add...*
. Select the _Email (SMTP)_ connector
. Click on *Next*
. Name the connector configuration _Send notification_
. Click on *Next*
. Set the following parameter values:
 ** SMTP host: _localhost_
 ** SMTP port: _2525_ (the port number specified in FakeSMTP)
 ** SSL (in the *Security* section): _unchecked_
. Click on *Next*
. Enter `no-reply@acme.com` in the *From* field
. Use the image:images/getting-started-tutorial/configure-email-connector/pencil.png[pencil icon] icon to edit the expression of the *To* field
. Set the *Expression type* to *Script*
. Paste the following Groovy script into the code editing zone: `apiAccessor.getIdentityAPI().getUserContactData(taskAssigneeId, false).email`
. Click on *OK*
. Click on *Next*
. Set _You have a pending task_ as the subject
. Click on *Finish*
+
image:images/getting-started-tutorial/configure-email-connector/configure-email-connector.gif[Email connector configuration]

Run the process with the connector configured, and see a new incoming email in the FakeSMTP user interface when task _Deal with unsatisfied customer_ becomes available.

You have now a process definition that uses a wide range of Bonita features. In the xref:design-application-page.adoc[next chapters], we will create an application on top of this process.
