Using API in email tools

Part 2 – Setting up API connections in SureTriggers

In this lesson we’ll use a WP plugin called SureTriggers.

I became a big fan of this group, SureCart, SureMembers, SureTriggers…they are fantastic. Their Astra theme is also solid.

The reason we’ll use SureTriggers, because even if it doesn’t directly connect to the tool you are using, you can send API requests easily.

Plus it has some remarkable advantages, like

  • automations can be triggered by a button placed on your site, pressed by your user, (!)
  • it can connect all your WP sites it’s installed on,
  • it’s the shred of the cost of Zapier,
  • it’s fast and easy to use (unlike Integromat(Make) or the quite poor Pabbly), aand
  • it doesn’t slow your site down, being a ‘headless’ plugin.

So. Step No. 0.Install the plugin from here.

You can start for free, then upgrade when needed. Their lifetime deal is also pretty sweet, can be paid partially over 10 months. 

Once installed, head over to the workflows section and click on Create. You should see this.

These tools all work on a similar Trigger (if happens) >> Action (do this) basis. 

Since we’ll create a new subscriber in our email tool, the trigger this case would be something like a form submission. 

I recommend connecting your WP account registration to the subscription.

When a visitor wants to subscribe, they create a user account on the site. 

This means that later you can lock certain sections and show only to registered users. It will make it easier later to add paid programs. 

The optin XP will be about the same. So this is how we’ll built it in this example, though you can chose to use just a form.

Trigger : New WP user added.

From the horde of apps we’ll choose WordPress, then select New user Created.

SureTriggers can fetch dummy data but it’s better to manually reg. a dummy user instead.

Send our new user to our Email tool

Of course first you want to check if the native integration isn’t there. SureTriggers doesn’t yet have the quadrillion connections of Zapier, but the more popular ones are all there.

For this lesson, we’ll send the lucky user to Loops, a mailer that’s not on the list.

Click on the + sign and choose API.

Remember your no-use cousin, JSON and his 5 word vocabulary? We select Post for this, as advised in the API help doc of Loops. 

Head over there, while you’re at it, and copy the Endpoint URL from the right hand side. (most API docs have a similar layout, look for it)

From the “Select Payload Type*” dropdown in Suretriggers, select your cousin, JSON. He will do the job. Or die trying.

Below, paste the URL you copied so bravely.

The Authentication method will be ‘Bearer Token’. This tells cousin that old story when you slept with a bear. So he knows it’s you. 

Paste the API key below, copied from your email tool.

Passing on the fine details

Cousin Jason will want to know who to rob exactly. It can’t be just anyone, now can it. 

Select adding parameters and copy the ‘Body’ elements from the doc you want to use. 

Email will be obvious and required, in this case I’ll be using First name, and a YES/NO boolean setting the confirmed status. 

Notice that the value we invite from the previous step using @. This will dynamically fill the user email of the person subscribed.

You may want to pass tags, custom fields, depending on what the mailer you use allows. It will be listed in the doc. Copy the key exactly as in the doc, then set the value. 

Simple.

Once you’re done, click on the sleepy-blue Test button. This will send the pigeon to cousin. Hopefully he is not drunk as a pig, and will reply something like this: 

This means that he’s done the deed, without a nervous breakdown. 

What a champ. 

Head over to your email tool and check if all is in order. Your test subscriber should be there eating a sandwich.

You completed this lesson. It feels almost surreal.

Updating a contact goes exactly the same way. Paste the Endpoint from the doc, use the parameters given. You are now an Olympic white-belt in API-do.