Written by The Jahia Team
 
Developers
Marketers
Sysadmins
   Estimated reading time:

Jahia Stack Connect allows you to easily integrate jExperience with over 250 applications, out of the box, and with a simple drag and drop UI. Below is an example of how to use Jahia Stack Connect to create Salesforce leads and send an email to the user when a jExperience goal (Link clicked) is reached.

Answer

Step 1: Setting up jExperience

First, we need to make sure that jExperience is correctly installed and the 'Click on Link' goal is created. You can find more information on the following articles:

  1. JExperience Quick Install
  2. Creating a Click on Link goal 

We will also need to obtain jCustomer API Key and credentials that will be used later to connect to Jahia Stack Connect (the default username and password are karaf/karaf). This configuration can be found in the installation guide: 

Step 2: Creating Jahia Stack Connect Workato Recipe

Workato uses the concept of Recipes which are sets of steps and actions to be performed to achieve integration and automation goals. A Recipe starts with a Trigger that listens to an event that happens on a business application, if an event is detected, the Recipe steps will be executed. To learn more about Workato and how Recipes work, please consult Workato documentation

In this example, we will configure a Trigger to check if a goal has been reached in JExperience and then create actions to upsert a Salesforce lead and send an email to the user. Jahia Stack connect provides several other actions and events that can be used. Please check our Jahia Stack Connect documentation for more information. 

  1. Lets's start by creating a recipe from the 'Recipes > Create new recipe'
    create_recipe.png
  2. Select the proper Jahia connector for your Jahia version, we will be using Jahia 7.3 here. Also, select the trigger event 'New Event'
    Select_event.png
  3. Next, you can create or select a connection to your jCustomer server. Key in the required information (obtained in Step 1 above), click 'Link your account' and then Next
    configure_Connection.png
  4. Select the 'Event Type' and the 'Start date' from which the trigger will start searching for events. For this example, select 'Goal reached'.
    trigger_setup.png
  5. In the next step, choose the action to be performed. In this example, we will search for the profile details that is associated with the event. Select Jahia 7.3 again, and select 'Get object by ID'.
    object_byID.png
  6. Select the 'Profile' object type, and drag the 'Profile ID' from the output fields (called datapills) of the first step to the 'Object ID' field.
    create_recipe_search_profile.png
  7. Click Finish. 
  8. The recipe is now ready to use but we don't have useful actions yet, close the success dialog for now so that we can add the remaining steps
    recipe_created-1.png
  9. Before moving on, we will need to make sure that the trigger only picks the events for the specific jExperience goal that has been created. To do so, click on the trigger in step 1, and add a 'Trigger condition'. You may drag the 'Name' field under 'Target > Metadata' in the datapills to the trigger condition
    goal_details.png
  10. Add a new step with an If condition to check if the profile has an email address. If the condition is met, use Salesforce connector and select Upsert a record of a Lead object. You can drag and drop the fields output of the previous profile search action to the appropriate Salesforce Lead fields
    upsert_salesforce.png
  11. Next, you can create another action to send an email to the user
  12. Finally, it is recommended to wrap your actions with an Error monitor (by adding a Handle Error action) as mentioned here. The final recipe should look something like this:
    full_recipe.png
  13. After saving the recipe, it's time to test if it works as expected. Click 'Test recipe' to see if events are correctly detected. Please trigger an event in your Jahia site by clicking on the specified goal link in 'Step 1' above and make sure that the goal is reached in JExperience. If the event is detected, a new job will appear under the jobs tab:
    jobs.png

Troubleshooting

If you found that there are issues while executing the recipe, it might be useful to check the following:

  • In the jobs tab, check if the job returned any error. You may click on the job to see its details and the output of each step.
  • Make sure that the goal is reached in JExperience
  • If the email field is null, make sure that the email address is public under the user's profile in Jahia under 'My dashboard > My settings > Privacy information'

Related links