Self Help - Email Sending Connector - Use Case
The use case enables users to write a message to the Support team in a form found in a Self Help procedure. The message will automatically be sent by email to the Support team.
Objects used
- Email sending connector: Send an email method.
Procedure
Overview
The implementation of the use case is performed in several phases:
- Phase 1: Create and configure the form for collecting information
- Phase 2: Configure the Email sending connector to send the message by email to the Support team
Phase 1: Create and configure the form for collecting information
Step 1: Create the form
The form enables users to write a message to be sent to the Support team.
1. Create a new form in the Resources folder of your Self Help project. Name it fcontactus.
2. Add the input fields as shown below.
- Four simple input fields:
- First name
- Name
- Email (mandatory field)
- Subject
- One multiple lines input field: Message
Step 2: Add the form to a procedure step
1. Create a new procedure in your Self Help project. Name it To contact us.
2. Create the first step, i.e. a Page step. Name it Entry.
3. Click and drag the fcontactus form to the step.
Phase 2: Configure the Email sending connector
Step 1: Create a new Connector resource
You create a Connector resource in order to send user messages by email to the Support team. This uses the Email sending connector and the Send an email method.
1. Create a new Connector resource in the Resources folder of your Self Help project.
- Select the connector, Email sending connector.
- Click Next.
2. Select the Send an email method.
Note:
- Do not define the default parameters specific to the method. They will be defined when the connector is added to the procedure.
- Do not modify the general connector configuration.
3. Click Next and click Finish.
The new Connector resource will be added to the Resources folder.
Step 2: Add the resource to a procedure step
1. Create an Action with Switch step after the Entry step. Name it Send mail.
Two branches will be created.
2. Click and drag the new Connector resource to the Send mail step and click Next.
The window for configuring input and output parameters for the method will appear.
3. Specify the input parameters of the method and click Next.
- From personal: Enter the form variable, fcontactus.first_name + ' ' + fcontactus.name (user's first and last names, a space is added to facilitate readability).
- To: Enter your company's email address surrounded by double quotes (" ").
- CC: Enter the form variable, fcontactus.email (user's email address).
- Subject: Enter the form variable, fcontactus.subject (subject entered by the user).
- Message content: Select the Variable option and enter the form variable, fcontactus.message (message written by the user).
4. Specify the output parameters of the method.
- Select the New variable checkboxes next to the result and error output variables to create them.
- Click Finish.
5. Click OK in the Parameters Refactoring window.
The Send an email method of the Email sending connector will be associated with the Send mail step. The user message can now be sent by email to the Support team.
Phase 3: Define the conditions for testing the call to the connector
You must add a condition to the error output variable of the Send an email method. If the variable is not null, this means that the call to the connector failed.
See the description of return codes
Step 1: Add a condition to check if the call to the connector failed
1. Define the condition that will show a failed process, indicated by a non-null value in the error output variable.
- Double-click the <cond.> branch in the Send mail step.
The window for defining the condition will appear.
- Select the error output variable.
- Select the is not null operator.
2. Click Finish.
The condition indicating a failed process will appear in the procedure.
3. Create a Page step after the <cond.> branch. Name it error.
4. Select the Content tab in the Description pane of the step.
5. Write a message informing users that the process failed and display the error stored in the error output variable.
Step 2: Process the results if the call to the connector was successful
1. Create a Page step after the default branch. Name it Success.
2. Select the Content tab in the Description pane of the step.
3. Write a message informing users that the process was successful.
Phase 4: Check that the procedure works correctly
1. Run the procedure.
2. Enter a message to be sent to the Support team.
3. Check that the relevant message appears if the process fails.
4. Check that the relevant message appears and that the email is correctly sent if the process is successful.