Send transactional SMS for customer and order events from Vendure via the seven gateway.
- Customer-Creation SMS - Welcome new customers automatically
- Order-Creation SMS - Confirm orders the moment they land
- Template Variables -
{{firstName}},{{lastName}},{{phoneNumber}},{{identifier}} - Per-Event Toggle - Enable each event independently
- Vendure 3.0.0 or higher
- A seven account with API key (How to get your API key)
The plugin lives inside your Vendure project. After cloning into plugins/seven/, register it in vendure-config.ts:
import { SevenPlugin } from './plugins/seven/seven.plugin'
export const config: VendureConfig = {
// ...
plugins: [
// ...
SevenPlugin.init({
apiKey: process.env.SEVEN_API_KEY!,
events: {
customerCreation: {
enabled: true,
text: 'Welcome {{firstName}} {{lastName}}!',
},
orderCreation: {
enabled: true,
text: 'Dear {{firstName}}, thanks for your order. We will notify you on shipment.',
},
},
}),
],
}SEVEN_API_KEY=your-seven-api-keyinterface PluginInitOptions {
apiKey: string
events: {
customerCreation?: { enabled: boolean; text: string }
orderCreation?: { enabled: boolean; text: string }
}
}| Placeholder | Description |
|---|---|
{{firstName}} |
Customer's first name |
{{lastName}} |
Customer's last name |
{{phoneNumber}} |
Customer's phone number |
{{identifier}} |
Customer's email / login identifier |
npm run dev # ts-node server + worker concurrently
npm run build # compile TS to dist/
npm run start # production server + worker| Problem | Solution |
|---|---|
| SMS not sending | Verify the API key, that the event is enabled and the customer has a phone number |
| Invalid phone number | Use E.164 format with country code, e.g. +491701234567 |
| Placeholder shows literally | Check the field exists on the customer object and the syntax is {{name}} |
Need help? Feel free to contact us or open an issue.