← View All Guides
Slack logo
Integration Guide

How to Set Up Referral Notifications in Slack with GrowSurf

Send real-time GrowSurf referral alerts directly to Slack channels using webhooks.

Keeping your team informed about referral activity in real-time creates accountability, urgency, and excitement. Slack is where modern teams communicate, so putting referral notifications in Slack means your sales team sees new referral leads instantly, your marketing team can track program momentum, and leadership can watch revenue attribution happen live.

This guide covers setting up a direct GrowSurf-to-Slack integration using Slack's Incoming Webhooks. Unlike the Zapier approach, this method gives you full control over message formatting, is completely free, and has zero third-party dependencies. You'll build a webhook handler that receives GrowSurf events and posts formatted messages to Slack.

Integration Steps

Step 1: Create a Slack App and Incoming Webhook

Set up a Slack app that can post messages to your workspace channels.

  • Go to api.slack.com/apps and click Create New App
  • Choose "From scratch" and name it "GrowSurf Referrals"
  • Go to Incoming Webhooks and toggle it on
  • Click Add New Webhook to Workspace and select your target channel (e.g., #referrals)
  • Copy the Webhook URL β€” you'll use this in your handler

Step 2: Build the Webhook Handler

Create a server endpoint that receives GrowSurf webhook events and forwards formatted messages to Slack.

  • Set up a POST endpoint (e.g., /api/growsurf-slack)
  • Parse the GrowSurf event payload
  • Format a Slack message using Block Kit for rich formatting
  • POST the formatted message to your Slack Incoming Webhook URL

Step 3: Design Rich Slack Notifications

Use Slack's Block Kit to create visually appealing and information-rich referral notifications.

  • Use sections with fields for structured data (referrer, referred, campaign)
  • Add context blocks for metadata (timestamp, referral code)
  • Include action buttons linking to GrowSurf dashboard and the participant's profile
  • Use different emoji for different event types for quick visual scanning

Step 4: Route Different Events to Different Channels

Send different types of referral events to appropriate Slack channels.

  • Create multiple Slack webhooks for different channels:
    • #referrals-all β€” all referral activity (high volume)
    • #sales-leads β€” only converted referrals (sales team notification)
    • #growth-wins β€” milestone achievements and top referrer alerts
  • Use conditional logic in your handler to route events to the right channel

Step 5: Add Rate Limiting and Batching

Prevent Slack notification fatigue during high-volume periods.

  • Implement rate limiting: max 1 message per 5 seconds per channel
  • During high-volume periods, batch notifications: "5 new referrals in the last hour"
  • Use a queue (Redis or in-memory) to collect events and flush periodically
  • Always send conversion and milestone notifications immediately (these are high-value)

Step 6: Test and Deploy

Validate your Slack integration end-to-end before going live.

  • Use GrowSurf's test mode to generate sample events
  • Verify messages appear in the correct channels with proper formatting
  • Test error handling: what happens when Slack is down or rate-limited?
  • Deploy and configure GrowSurf to send webhooks to your handler URL

Code Snippets

// Direct GrowSurf to Slack webhook integration
const axios = require('axios');

const SLACK_WEBHOOKS = {
  all: process.env.SLACK_WEBHOOK_ALL,
  sales: process.env.SLACK_WEBHOOK_SALES,
  wins: process.env.SLACK_WEBHOOK_WINS
};

function formatReferralMessage(event, participant, referrer) {
  const eventEmojis = {
    'PARTICIPANT_CREATED': ':wave:',
    'PARTICIPANT_REFERRED': ':sparkles:',
    'CAMPAIGN_REFERRAL_CONVERTED': ':tada:'
  };

  const eventLabels = {
    'PARTICIPANT_CREATED': 'New Participant',
    'PARTICIPANT_REFERRED': 'New Referral',
    'CAMPAIGN_REFERRAL_CONVERTED': 'Referral Converted!'
  };

  return {
    blocks: [
      {
        type: 'header',
        text: {
          type: 'plain_text',
          text: `${eventEmojis[event]} ${eventLabels[event]}`
        }
      },
      {
        type: 'section',
        fields: [
          { type: 'mrkdwn', text: `*Participant:*\n${participant.email}` },
          { type: 'mrkdwn', text: `*Referrer:*\n${referrer?.email || 'Direct'}` },
          { type: 'mrkdwn', text: `*Referral Code:*\n${participant.referralCode}` },
          { type: 'mrkdwn', text: `*Total Referrals:*\n${referrer?.referralCount || 0}` }
        ]
      },
      {
        type: 'actions',
        elements: [{
          type: 'button',
          text: { type: 'plain_text', text: 'View in GrowSurf' },
          url: `https://app.growsurf.com/dashboard/campaign/${participant.campaignId}/participants`
        }]
      }
    ]
  };
}

app.post('/api/growsurf-slack', async (req, res) => {
  const { event, participant, referrer } = req.body;
  const message = formatReferralMessage(event, participant, referrer);

  // Send to appropriate channel
  await axios.post(SLACK_WEBHOOKS.all, message);

  if (event === 'CAMPAIGN_REFERRAL_CONVERTED') {
    await axios.post(SLACK_WEBHOOKS.sales, message);
  }

  res.json({ success: true });
});

Tips

Use Slack Block Kit Builder for Message Design

Slack's Block Kit Builder lets you visually design and preview your notification messages. Design your referral notification format there first, then copy the JSON into your webhook handler. This saves time compared to trial-and-error with raw JSON.

Include Actionable Buttons in Notifications

Add buttons that link to the participant's GrowSurf profile, their company's website, and their LinkedIn profile. This gives sales reps one-click access to all the context they need to follow up on a referral lead immediately from the Slack notification.

Set Up a Daily Digest for Leadership

Instead of real-time notifications, send leadership a daily digest at 9 AM with: total referrals yesterday, conversions, top referrer of the day, and program health metrics. Use a scheduled cron job that queries GrowSurf's API and posts a summary to a leadership channel.

FAQ

Can I use Slack's native webhook instead of building a custom handler?

You could point GrowSurf's webhooks directly at a Slack Incoming Webhook URL, but GrowSurf's payload format doesn't match Slack's expected message format. A handler in between lets you transform the data into a properly formatted Slack message with rich formatting, routing, and error handling.

How do I handle Slack's rate limits?

Slack's Incoming Webhooks allow 1 message per second per webhook URL. If your referral program generates more than 60 events per minute, implement a message queue that batches notifications. For most programs, rate limits aren't an issue β€” it would require very high referral volume to hit them.

Can I make the Slack notifications interactive (approve/reject referrals from Slack)?

Yes, but this requires a more complex setup using Slack's interactive messages (Block Kit with actions) and a Slack app with an interactivity URL. The buttons would call your server, which then calls GrowSurf's API to approve or reject referrals. This is an advanced setup beyond basic notifications.

Set up your refer a friend program with customer referral and affiliate program software that lowers your acquisition costs, increases customer loyalty, and saves you gobs of time.

Trusted by marketing and product teams at fast-growing B2C, fintech, and SaaS companies