Self Help - Email Sending Connector - Use Case

Last modified on 2023/08/09 14:31

  To help you set up this use case, you can download the relevant documentation and sample project. Open url.png See List of files to download

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

Procedure
        Send email connector - Use case - Procedure.png

Overview

The implementation of the use case is performed in several phases:

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
            Send mail connector - Use case - Form.png
     

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.

          Send mail connector - Use case - Step Input information.png

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.
            Send mail connector - Use case - Add Email connector.png

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.

          Send mail connector - Use case - Email connector - General parameters.png

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.
        Send mail connector - Use case - Step Send mail.png

2. Click and drag the new Connector resource to the Send mail step and click Next.

Caution: You must not modify the general configuration.

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).

          Send mail connector - Use case - Input parameters.png

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.
            Send mail connector - Use case - Output parameters.png

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.
   Open url.png 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.
            Send mail connector - Use case - Add condition.png

2. Click Finish.

The condition indicating a failed process will appear in the procedure.
        Send mail connector - Use case - Condition for Error added.png

3. Create a Page step after the <cond.> branch. Name it error.

          Send mail connector - Use case - Condition for Error - To display message.png

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.

          Send mail connector - Use case - Add condition - error.png
 

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.

          Send mail connector - Use case - Condition for Success - To display message.png

2. Select the Content tab in the Description pane of the step.

3. Write a message informing users that the process was successful.

          Send mail connector - Use case - Add condition - success.png

Phase 4: Check that the procedure works correctly

1. Run the procedure.

2. Enter a message to be sent to the Support team.

          Send mail connector - Use case - Test procedure - Entry informations.png

3. Check that the relevant message appears if the process fails.

          Send mail connector - Use case - Test procedure - Error process.png

4. Check that the relevant message appears and that the email is correctly sent if the process is successful.

          Send mail connector - Use case - Test procedure - Success process.png
         Send mail connector - Use case - Test procedure - Success.png

List of files to download

Tags:
Powered by XWiki © EasyVista 2022