support center

Integrating Your Email Automation Provider Using Zapier: Step 2, Ending the Campaign

While Woodpecker automatically ends the campaign for the individual should the contact respond to you, you can also set up a second zap to stop emails to an entire lead if you move the lead into a particular status. This is the final steps to the email integration as explained here.

To set up the second zap, head to your dashboard and choose the orange “Make A Zap!” button.

Step 1.  The Lead Status Change Trigger
Choose for the trigger app and select “New Lead Status Change” as the trigger action. Choose your account (needs to be the same as in the first zap you created), click Continue, and test the zap.

Step 2.  The Filter by Step
Choose "Filter by Zapier" for the trigger app and select “Only Continue If.” Choose your filters on the next screen. In this case, we only wanted to stop the campaigns emails if the old status label was “Potential” and the new status label was “Interested.” For our use case, this meant that once the rep had found the right contact at the company to pitch to, and had determined that the contact was interested, all cold email campaigns should stop for the rest of the company. You can customize this and choose what makes sense for your campaign. 

Test this step and Continue.

Step 3. The Find Lead Action

Choose as the trigger app and “Find Lead” as the trigger action. Select your account and continue. On the mapping page, select Search by Lead ID, and click the plus sign to choose the correct field. From the option of Find Lead, choose the Lead ID as the field to search by. Continue and test the step.

Step 4.  The Java Script Action

Choose Code by Zapier as the next step and then “Run Javascript.” Edit the Template. Under Input Date, write RawText. In the next step, choose the plus sign, then “Find Lead”, then “Contacts Emails Email.”
For the code step, copy this javascript into the code box:

var emails = inputData.rawText.match(/([\w._-]+@[\w._-]+\.[\w._-]+)/gi) || [];
return {
   return {email: email};
output = inputData;

The template should look like this:

Step 5. Choose Your Email Automation Provider  (Woodpecker)

Here’s where we connect the email automation provider. Choose as the trigger app and “Create/Update Prospect” for the trigger action. Choose your account (should be the same as in the first zap), click Continue and move to the template.

On the template, select the plus sign from the “Prospect Email to Add” field, then click on Step 4 and then Email. From the dropdown for the “Update Existing Record” field, choose Update. On the Prospect’s Status field choose BLACKLIST. 

Click Continue. To test this step, move a lead that has contacts enrolled in a Woodpecker campaign from the old status that you chose in Step 2 to the new status that you chose in Step 2. Then run your zap from the Zapier dashboard. All of the contacts should be pushed to blacklist status in