Table of Contents

Automate your MainWP Workflow with SureTriggers

Video Transcript

SureTriggers is a powerful automation platform that helps you connect your various plugins and apps together. It allows you to automate repetitive tasks so you can focus on more important work.

SureTriggers features over 200 integrations, and MainWP is one of them.
That means you can set up various kinds of workflows to automate MainWP functionality.

Some examples include automatically adding relevant information to a Google Sheet after a new child site is added, or suspending a site after a contact form is submitted.

In this video, we will cover the scenario where a paying client submits a form through their WooCommerce My Account page in order to add their site to your MainWP Dashboard.

For this, we will use two WordPress sites. One site will be where the MainWP Dashboard is installed, and the other will be where WooCommerce and Suretriggers will be set up to collect form submissions.

SureTriggers interacts with the MainWP Dashboard using the REST API. So, the only thing we have to do on the MainWP Dashboard site is create an API key and give it all permissions.
Make sure to save the Consumer Key and Secret. We will use it to connect the Dashboard to the Suretriggers plugin.

That’s all that we have to do on the Dashboard site, so let’s now move on to the other WordPress site.

We will assume that you already have your SureTriggers account created and the WooCommerce plugin configured on this WordPress site.

Let’s now install the SureTriggers plugin. After activating it, we’ll click the Get Started Now button. We have one last step and that is to connect the plugin with our SureTriggers account by clicking Authorize and Continue. It will then take you back to your WordPress site, and you can now see the SureTriggers Dashboard.

Let’s now connect our MainWP Dashboard to Suretriggers. Click on Apps. Here, you will see the connection to the WordPress site we’re currently on. Now click on Add New Connections. Here you can see a list of apps and services that you can connect. Search for MainWP, and click on the MainWP icon.
New browser tab will open and a form will open where you can type in the required MainWP Dashboard information.
Give it a unique and memorable title. Then the URL of your Dashboard.
And then the Consumer Key and Consumer Secret that you saved earlier, and click the Connect MainWP button.
You have now connected the MainWP Dashboard to Suretriggers, and a new connection is now visible in the Suretriggers plugin.

The next step is to install and configure a contact form plugin, which we will use to collect the necessary information to add a site to the MainWP Dashboard. Our contact form plugin of choice is WS Form. But keep in mind that many other contact forms plugins are also supported by SureTriggers.

Let’s search for the WS Form plugin. Install and activate it.

Now, let’s create a contact form. We’ll use a Blank template.
We will give the contact form a descriptive title. And start adding the fields.

We need three pieces of information for adding a child site to the MainWP Dashboard.
First is the Site URL, so let’s add a field and make it required.
Next is the Admin username of the child site. And the last field is the Site title. Finally, we add the Submit button and publish the form.

We’ve inserted the form’s shortcode in the WooCommerce’s PHP file, but you can insert it in any way you wish. The reason we chose the WooCommerce My Account page is to avoid making the form publicly accessible.

The last piece of the puzzle is creating a Workflow that will link the form with the MainWP Dashboard.

Navigate to SureTriggers and then Workflows. Give the Workflow a name, and click Start Building. First we have to set up a trigger. Click the Add Trigger button, and now we’ll select an app from which this trigger is going to come from. In our case, that’s going to be WS Form.
Then we have to choose the event. Here, we only have the Form Submitted event so let’s move to the Connections. Here, you will see a list of all connected WordPress sites. Select the desired site and and then from the dropdown, select the contact form you’ve created in your Contact form plugin. We’ll select the Add new site form that we just created.
Now, we’ll make a sample form submission so the Suretriggers can see what data it should expect from that contact form.
We’ll navigate to our other tab where we have the WooCommerce My Account page open, fill out the form and submit.
When we navigate back to our SureTriggers tab, we can see that it has successfully fetched the information we just submitted. Trigger is now set up so let’s click the Save button.

Now, we’re going to set an action. The way we do that is by clicking the plus icon. The action is going to be adding a site on the MainWP Dashboard, so let’s search for MainWP and click on the icon.
Here, we will select the event “Add New Site”. Next step is selecting the connection. In this dropdown, we see the MainWP Dashboard we connected earlier using the REST API, so let’s select that.
Finally, we have to match the information that’s going to be submitted in the contact form to the appropriate MainWP data fields necessary to add a child site.
Simply type in the “at” symbol, and choose the relevant data point from the dropdown. Repeat that process for all three data fields, and finally click “Save”.

Now that the both the trigger and the action has been configured, click the Publish button.

We have completely configured Suretriggers so let’s test it out and see how it works in action.

We have prepared an empty WordPress site that we will add to the Dashboard using the form. We’ve installed and activated the MainWP Child plugin so the site is ready to be added to the Dashboard.
Let’s fill out the form with the necessary information, and submit the form.

Now we’ll navigate to our MainWP Dashboard, and refresh the Manage Sites page. And there we have it – the child site has been sucessfully added to our MainWP Dashboard.

This is just one possible scenario out of many. The MainWP integration supports one Trigger which is “New Site Connected” and five actions: Add New Site, Disconnect Site, Remove Site, Suspend Site, Unsuspend Site.
Considering that the Suretriggers supports more than 200 integrations in total, the possibilities are truly limitless.

Thank you for watching and if you enjoyed this video, please make sure to like and subscribe for more updates from MainWP.

Still Have a Questions?
Search for additional solutions in the MainWP Community or start your own discussion