Enroll in a course of Site B when a purchase is made in Site A

Let’s try with a real example. You have a Marketing Site with a Cart page created with WooCommerce (Site A), and a Learning System made with LifterLMS (Site B).

Note: This tutorial is applicable to any other of the LMS plugins that AutomatorWP supports like LearnDash, LearnPress, Tutor LMS, etc.

The schema

Site A

When user purchases a product

Send data to Site B

Site B

On receive data from Site A

Enroll user in a course

What do you need

Disclaimer: This tutorial will show the minimum workflow and data you have to fill in to complete the connection between sites. You can set the number of data collect, filling every webhook field you need, and using those Tags you want.

On Site A

Set the Trigger

  1. Create an Automation: AutomatorWP > Add New Automation > Anonymous > Confirm.
  2. Enter a Title for the Automation
  3. Create a Trigger: WooCommerce > Guest purchases a product.
  4. Click on any product if you would like only to track a specific product, select it, and click Save.

Set the Action

Here we will set an action that you do not need to create a new user every time a purchase occurs. What we recommend is to create a user who only will be used to perform these automations.

  1. Click on Existing User.
  2. Select for example ID on Field to search the user 
  3. Enter the User ID you will use, our example, 1.
  4. Add another Action > AutomatorWP > Send data to webhook.
  5. Click the webhook button.
  6. Paste the URL you have copied from Site B.
  7. Enter the key or keys you would like to send. For example, email.
  8. In the Value field, click on Tag Menu and select the tag Customer Billing Address > Email.
  9. Add every data you need and want to catch from the WooCommerce order.
  10. Save the action.
  11. Save & Activate. Make sure you have entered the Webhook URL generated by the Site B Action.

Note: on step 2, you can choose between ID, email, or username. Whatever you select and configure, the automation will run in the same way.

Note: you should return to step 6 when you generate the URL from the Webhook Action in Site B.

On Site B

Set the Trigger

  1. Create an Automation: AutomatorWP > Add New Automation > Anonymous > Confirm.
  2. Enter a Title for the Automation.
  3. Create a Trigger: AutomatorWP > Receive data from webhook.
  4. Click webhook button
  5. Enter the key or keys you would like to send. To create an account, you will need an email. So type email, and set its type as text.
  6. Copy the URL field that the site has generated, and Paste it on Site A Action Webhook (step 6 from On Site A, Set the Action section).
  7. Save the Trigger.

Set the Action

  1. Click on Existing User.
  2. Select Email on Field to search the user 
  3. Click on Tag Menu and select Receive data from webhook > email.
  4. Select Create a new user on What to do if the user doesn’t exist checkbox field.
  5. Fill username by clicking on Tag menu > Receive data from webhook > email.
  6. Same for the email field.
  7. (Optional) Fill those fields you would like to enter.
  8. Save Action.
  9. Add another Action > LifterLMS > Enroll or unroll user from a course.
  10. Click on all courses and select the course you want.
  11. Save Action.
  12. Save & Activate.

Well done! Both sites are ready to send data from course purchases and, when that happens, the user will be enrolled automatically in the Site B LMS platform!