
Send Messages with MessageBird
Made by MessageBird
Sends messages and notifications using the MessageBird Conversations API.
How this extension works
Use this extension to send omnichannel messages (SMS, WhatsApp, Google's Business Messages, Messenger, Telegram, Line, Viber, etc.) with MessageBird . When a document is added to a specific Firestore collection, this extension will use the MessageBird Conversations API to convert that document to a message and update the document with the delivery status.
db.collection('YOUR_DOCUMENT_COLLECTION').add({
channelId: 'YOUR_CHANNEL_ID',
type: 'text',
content: {
text: 'YOUR_MESSAGE_CONTENT'
},
to: 'RECIPIENT_OF_THE_MESSAGE',
});
Note: You can find full list of supported message types and required content fields in the Conversations API docs .
Additional setup
Before installing this extension, set up the following Firebase services in your Firebase project:
- Cloud Firestore to store message documents.
- Follow the steps in the documentation to create a Cloud Firestore database. You must have a MessageBird account and a MessageBird API access key before installing this extension. You will also need to create the appropriate channels (an SMS channel, a WhatsApp channel, a Facebook Messenger channel, a Telegram channel, etc.) that you'd like to use to send out messages as you will need to specify the channel when sending messages.
Step by step MessageBird account setup
- Create a MessageBird account on the MessageBird page , and when asked, choose the "APIs" path
- Once your account is created, you can see your API key either on the dashboard or in the Developer settings page.
You can set up the channels you would like to use on the Channels page
- for SMS you will need to acquire a sending number
- for WhatsApp you will need to create a WhatsApp for Business Account by following the WhatsApp installation wizard . You might also need to create an WhatsApp message template if you want to send out-of-session WhatsApp messages .
- for other channels, follow the instructions on the Channels page
Note: MessageBird also has a test mode that lets you make API calls without sending actual messages. You can use it for testing purposes to avoid extra cost during development.
Billing
This extension uses the following Firebase services which may have associated charges:
- Cloud Firestore
- Cloud Functions
This extension also uses the following third-party services:
- MessageBird Billing ( pricing information )
You are responsible for any costs associated with your use of these services.
Note from Firebase
To install this extension, your Firebase project must be on the Blaze (pay-as-you-go) plan. You will only be charged for the resources you use. Most Firebase services offer a free tier for low-volume use. Learn more about Firebase billing.
You will be billed a small amount (typically less than $0.10) when you install or reconfigure this extension. See Cloud Functions under Firebase Pricing for a detailed explanation.
How to install this extension
Using the Firebase console
To install and manage extensions, you can use the Firebase console.
Install using consoleUsing the Firebase CLI
To install and manage extensions, you can also use the Firebase CLI:
Step 1: Run the following npm command to install the CLI or update to the latest CLI version.
npm install -g firebase-toolsDoesn't work? Take a look at the Firebase CLI reference or change your npm permissions .
Step 2: Set up a new Firebase project directory or navigate to an existing one
Step 3: Add this extension to your extension manifest by running
firebase ext:install messagebird/firestore-messagebird-send-msg --local --project=projectId_or_alias
Step 4 (Optional): Test this extension locally with the Firebase Emulator Suite
firebase emulators:start
Step 5: Deploy the extensions in your manifest to your project
firebase deploy --only extensions --project=projectId_or_alias