Demos

How to create an order confirmation process

11min

Scenario: We will create a process flow that can be very useful for every ecommerce platform as it represents one of the steps they need to perform in the end-to-end selling process. Every time an order is placed by a customer, they receive confirmation details via email/SMS. 

 This will be a basic scenario where PROCESIO can help you with sending the confirmation email and SMS to the customer, together with the invoice and order details.

Before you get started: by the end of the process creation, we will configure:

  • a configuration to an email server that will be used to send the email.
  • a configuration to a REST API of an web-to-sms service. 
  • the above requires the creation of 2 connection configurations in the Credentials Manager.

Let's build this process! 

The process flow created will look like this:

Document image


Create the credentials

Step 1. Create the email server configuration: Go to Credentials Manager section and click on Add New button. This will take you to the Basic Info step of the configuration. Fill in the inputs like below: 

Document image


Click Next step to take you to the next step of the configuration, i.e. Details

For this demo we have created a connection to a Gmail server, check the GMail documentation.

You can also create and use a connection to any email server (check Yahoo or SendGrid connection documentation).

See below how the email server configuration for sending out emails from your Gmail account is configured (add your Gmail username & app password):

Document image


Click Test connection to see if you completed the settings correctly. If the test is successful, click Save to save this configuration. We will use this configuration in setting up the SendEmail action.

Step 2. Create connection to the web-to-sms service provider you want to use. Similar to the email server config, go to Credentials Manager section to set it up. For this demo we used SMSO's API (check documentation for SMSO connection).We will use this API configuration in CallAPI action.

Create and configure the process

Step 1.  Create a new process: Go to the Process Designer section and click on the Create New button. This will take you to the canvas where you will build the flow.

Step 2. Add Send Email and Call API actions on canvas and connect them by dragging relations between all the actions. 

Document image


Step 3. Create the process variables: as mentioned at the beginning, we want to automate this process and make it pass dynamic data such as customer name, email, order id etc. Thus, we need to create some process variables within our process flow, which will act as data placeholders while designing the flow. At runtime, they will take new values. 

Go to Process Variables (x) in top bar to start creating the variables needed for this process. Click Add Variable. You need to define variables as follows:

Document image


Step 4. Configure the SendEmail action.

  • Click on it and the properties panel will open. You can rename it from Send Email to Email - order confirmed. 
  • Select the email server configuration created in step 1.
  • Click on the Send Email card to proceed to the next steps:
Document image


Configure the parameters of the action:

  • The From field will set the display name of the sender. The actual email address of the sender is the one set in the Credential Manager, but we can set the display name to be anything we want. I’ll use “Shop Name”.
  • The To: <%customeremail%> variable.
  • The Subject: <%customerName%>, your order is now confirmed!
  • The Body:
Text


To open the variables selector in Body and add process variables to your message: press Insert key (for Windows) or Shift + Tab (for MacOS)

Document image

  • The attachment will be the <%invoice%> variable created earlier.
Document image


Step 5. Configure the Call API action which is the send SMS step.

  • Click on Call API action and the properties panel will open. You can rename it from Call API to Send SMS.
  • Select the API configuration created in step 2.
  • Click on Configure Request to proceed next steps:
Document image


For the Call API configurations you are going to check the SMS provider's API documentation regarding the method name, parameters needed, etc. 

We’ll select the verb POST. As you can see here the URL is prefilled. This comes from the REST API credential configuration. I just need to specify which method name to use to have a valid endpoint - /api/v1/send

Add the needed query parameters:

  • to<%customerPhone%> variable
  • body<%customerName%>, your order orderId (variable)has been confirmed. Thank you for your purchase!
  • sender: 4 (as per SMSO REST API documentation, you'll need to set it).
  • Status output will contain the <%smsOutput%> variable.
  • Save the changes.
Document image


Use the Activate multi line Editing functionality in order to expand the editor:

Document image


Step 6. Save the process. Validate the process. Run the process.

Document image


Fill in the values for the input variables declared and press Run:

Document image


Once the process completes, a notification will appear. Click on the Check instances button to view the details at the process and action level:

Document image


Congrats! You have just created a new process flow in PROCESIO!

If you encountered any issues while creating this first process flow, please let us know as we are all growing together.