/
Blog
/
Sending a Group Message with Sendblue's Group Message API
April 10, 2025
6 min read
Nikita Jerschow

Sending a Group Message with Sendblue's Group Message API

The Sendblue API allows you to send iMessages (and SMS) to groups of people. This is a great way to send messages to your clients, customers, friends, or family. In this article, we'll take a look at how to use Sendblue's Group iMessaging Beta to notify system administrators when a Stripe subscription is created.

Sending a Group Message with Sendblue's Group Message API

What is Sendblue?

Sendblue is a messaging platform that allows you to send iMessage and SMS. It's a great way to send messages on behalf of your business. Because iMessage is internet-based, all messages have a flat rate and aren't priced by segment. This means that the length of your message does not impact how much it costs to send, and you also don't need to deal with formatting issues on the receiving side.

iMessage also has a much higher media size limit than SMS, which means you can send larger files & high-res images to your recipients, all for the same price as a single message.

Setting up the Sendblue Notifier

We'll start by setting up a Sendblue client in our workspace. This will allow us to send arbitrary messages from anywhere in our codebase. We'll also set up a webhook to receive status updates for Stripe Subscriptions.

1. Configuring the Sendblue Client

To send Sendblue group iMessages, make sure that you have signed up for an account (https://sendblue.com/signup). Once you've signed up, you can find your Sendblue API key in your [api settings](https://sendblue.com/dashboard/api). Then you can use the Sendblue client to send messages to groups of people:

in `sendblue_client.py`:

```python

from sendblue import Sendblue

client = Sendblue(api_key="YOUR_API_KEY", api_secret="YOUR_API_SECRET")

client.send_group_message(

numbers=["+19998887777", "+19998887778"],

content="Testing a group message!",

media_url="https://picsum.photos/200/300.jpg",

)

```

Of course, you will want to replace the api key and secret with your own. You can also replace the numbers and message content.

Once you are able to verify that the messages are coming through with this simple script, you can move on to the next step.

2. Configuring the Stripe Webhook

Assuming you have followed [Stripe's basic subscription payments tutorial](https://stripe.com/docs/billing/quickstart), you should have a Stripe workflow setup. Now we just need to add a notification to the workflow to send a message to our group when a subscription is created.

First, make sure that the webhook is configured to send a notification to Sendblue. You can do this by going to the [webhook settings](https://dashboard.stripe.com/webhooks) and adding a new webhook endpoint. The endpoint should be the URL of your backend server. It should look something like this:

![Stripe webhooks](assets/images/group-message/stripe-subscription.png){: width="80%" }

Correctly Configured Stripe Webhook

{: style="color:gray; font-size: 80%; text-align: center;"}

3. Inserting a Notification for Stripe Subscriptions

Once you've added the webhook, you can add the Sendblue code from before into your Stripe webhook handler. This will send a message to your webhook when a subscription is created. This is what your webhook handler should look like before adding Sendblue:

```python

import json

import os

import stripe

from flask import Flask, jsonify, request

# This is your Stripe CLI webhook secret for testing your endpoint locally.

endpoint_secret = 'whsec_YOUR-WEBHOOK-SECRET'

app = Flask(__name__)

@app.route('/webhook', methods=['POST'])

def webhook():

event = None

payload = request.data

sig_header = request.headers['STRIPE_SIGNATURE']

try:

event = stripe.Webhook.construct_event(

payload, sig_header, endpoint_secret

)

except ValueError as e:

# Invalid payload

raise e

except stripe.error.SignatureVerificationError as e:

# Invalid signature

raise e

# Handle the event

if event['type'] == 'customer.subscription.created':

subscription = event['data']['object']

# ... your custom handler for new subscriptions

else:

print('Unhandled event type {}'.format(event['type']))

return jsonify(success=True)

```

Next, add an import to the Sendblue client at the top of this module like so:

```python

from sendblue_client import client

ADMIN_NUMBERS = ["+19998887777", "+19998887778"] # replace with your own numbers

```

Then, add the following code to the `customer.subscription.created` handler:

```python

...

if event['type'] == 'customer.subscription.created':

subscription = event['data']['object']

# ... your custom handler for new subscriptions

client.send_group_message(

numbers=ADMIN_NUMBERS,

content="There was a new subscription! " + subscription["id"],

media_url="https://picsum.photos/200/300.jpg",

)

...

```

How to Get People to Respond to Your Texts: Four Key Strategies

When done right, texting is one of the most effective ways to engage leads. Yet it’s not just about hitting “send.” Below are four proven strategies (minus a couple of special-case tips) that can help your messages stand out—and get actual responses.

1. Act Fast: Reach Out Within 3–5 Minutes

Timing is everything. Texting a lead too late can mean missing out on their initial excitement, curiosity, or immediate availability. Ideally, aim to send your first text within 3–5 minutes after someone expresses interest or submits an inquiry. This quick response shows potential customers you’re attentive and available, which immediately increases trust and engagement.

Why it Works:

  • Captures attention: People are still thinking about your product or service.
  • Builds trust: Quick replies imply high-quality support.
  • Positions you ahead of competitors: Many businesses wait much longer—so you stand out by being prompt.

2. Use Multiple, Shorter Messages

Rather than sending a single, blocky text, try splitting your thoughts into two quick messages. Why? It feels more personal and less automated. It also nudges the recipient with two notifications instead of one, doubling the chances they’ll notice you.

Example Flow:

  • Message 1: “Hi Taylor, thanks for reaching out!”
  • Message 2: “Do you have a moment to discuss the pricing options?”

This approach mimics a natural conversation style. People text like this with friends, so a string of two or three short messages can feel more human than a single oversized chunk.

3. Follow Up with Care & Strategy

More messages do not always equal more responses. Overdoing it can make you look spammy or desperate. Instead, plan each follow-up to add context or value, referencing what you sent before or addressing a potential question.

Best Practices for Follow-Ups:

  • Space them out: Give your leads some breathing room—24 hours or more if they haven’t responded.
  • Keep it concise: A simple check-in is often enough.
  • Limit your attempts: After two or three follow-ups without any response, it may be time to step back and rethink your outreach strategy or channel.

4. Wait to Send Links Until You Get a Response

We’ve all gotten that random text with a link and thought, “Spam!” To avoid that perception, hold off on including any links until your contact has actually replied. Not only does this feel more authentic and less salesy, but there’s a bonus for iOS users: once a person responds, Apple devices often provide a more attractive embedded link preview, boosting click-through rates by up to 10x.

Why Delay the Link?

  • Builds trust: You show you’re focused on genuine conversation first.
  • Increases clicks: Eye-catching previews on iOS devices stand out in the chat.
  • Prevents spam vibes: You avoid the immediate red flag of an unsolicited link.

We'll start by setting up a Sendblue client in our workspace. This will allow us to send arbitrary messages from anywhere in our codebase. We'll also set up a webhook to receive status updates for Stripe Subscriptions.

Final Thoughts

Getting people to respond to your texts takes more than just hitting “send.” By reaching out quickly, using multiple short messages, being thoughtful in your follow-ups, and saving links for when your lead is already engaged, you’ll give your texting strategy the best shot at success—without overwhelming the conversation. Test these tips, monitor your response rates, and continue to refine your approach for maximum impact.

Happy texting—and here’s to higher response rates!

Conclusion

Violà! You should now be able to send group messages to your admins when a new subscription is created.

Keep in mind that this implementation is just an example and is only scratching the surface of what you can do with iMessage. You could add texts whenever someone cancels, or you could event start a texting cadence when a customer is about to cancel. The possibilities are endless!

If you have any questions, feel free to reach out to us on [Twitter](https://twitter.com/sendbluedotco).

Don't leave us on read

Drive sales with the most engaging messaging channel.

Request a demo