New Lead Notifications in Slack Using Campaign Triggers

This article will cover how to receive new lead notifications in Slack using Campaign Triggers. To watch a tutorial on this topic click here


Start by creating a channel in Slack where you want the notifications to be sent. For this example we created a channel named slack-webhook-solar-test


You’ll then go to https://api.slack.com/apps/. Click “Create New App” and select “From Scratch”

Give your app a name and select the workspace to develop the app in

Once you’ve created the app, go to “OAuth and Permissions” under the features section and scroll down to scopes

Here you will add the scopes chat:write, chat:write.customize, and chat:write.public

Next, scroll up to OAuth Tokens for Your Workspace and click Install to Workspace

Click Allow on the next page

On this page you will see your token under Bot User OAuth Token. You’ll copy and paste this into your Lead Prosper Campaign Trigger set up later 

Next, you’ll click on Incoming Webhooks under the Features section on the left. Turn Activate Incoming Webhooks to ON. You’ll then be prompted by the yellow bar at the top of the screen to Reinstall the App

On the next page, you’ll select the Slack channel you created earlier as the destination for the webhook to post. Click allow and then Install App under Settings

Here you will see the Webhook URL that will be used to send messages to a channel. This will be the URL that we will add for our campaign trigger


The next step is to construct the payload that you’ll copy and paste into Lead Prosper using Slack’s internal Block Kit Builder (https://app.slack.com/block-kit-builder/ ). A copy of the payload used is below, copy and paste this into your own block kit builder and your App will be formatted the same as the sample in this document:

{

"blocks": [

{

"type": "header",

"text": {

"type": "plain_text",

"text": "New Lead - {{lp_campaign_name}}",

"emoji": true

}

},

{

"type": "section",

"text": {

"type": "plain_text",

"text": "Sold To: {{lp_buyer_name}}",

"emoji": true

}

},

{

"type": "section",

"text": {

"type": "plain_text",

"text": "Price: {{lp_lead_sell_price}}",

"emoji": true

}

},

{

"type": "section",

"text": {

"type": "plain_text",

"text": "Status: {{lp_lead_status}}",

"emoji": true

}

},

{

"type": "section",

"text": {

"type": "plain_text",

"text": "First Name: {{first_name}}",

"emoji": true

}

},

{

"type": "section",

"text": {

"type": "plain_text",

"text": "Last Name: {{last_name}}",

"emoji": true

}

},

{

"type": "section",

"text": {

"type": "plain_text",

"text": "Email: {{email}}",

"emoji": true

}

},

{

"type": "section",

"text": {

"type": "plain_text",

"text": "Phone: {{phone}}",

"emoji": true

}

}

]

}

On the left you can easily format the way a new lead will look when it’s sent into Slack. Once you have it formatted the way you’d like, click copy payload at the top. Here, in addition to the lead data we are also adding fields for Lead Prosper specific data such as price, buyer id, and the lead status


You’ll then go to your Lead Prosper campaign. Scroll down to the bottom of the campaign homepage to the Campaign Triggers section and Click the New button

Give your Webhook a name then select Lead Status and set the condition Equal to Accepted. This will ensure that only Accepted Leads are posted to Slack. You can configure this any way you like. If you want notifications for all leads, select “any of” and choose all statuses

The Next step is to build out the action. Give your action a name, then copy and paste the post URL you got from the webhook section in your Slack app setup. The Request Method is POST and the Payload Type is JSON



You’ll then copy and paste the payload from the Slack Block Kit Builder into the payload builder in Lead Prosper. When customizing the slack message body, you can use all the lead data points or any of our special shortcodes, like who bought the lead, how much the lead sold for and so on. In our example message, we'll use lp_campaign_name shortcode for the message title, and we'll use the next lines to identify the lead buyer and the price that we sold the lead for. Remember you can customize this message at any time

Under Headers, Content-Type is automatically added when you select the Response Type above. The next Header will be called Authorization and have a value of Bearer followed by the OAUTH Token you received earlier in the Slack app set up


Click Add then Test to make sure that your setup worked. Generate some dummy data and hit Send Request



Once you get a successful response, click over to Slack to make sure that you received the test lead

That’s all for setting up new lead notifications in Slack using Campaign Triggers. If you have any questions please use the support button or email us at support@leadprosper.io     

Still need help? Contact Us Contact Us