Skip to content

seven-io/vendure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

seven logo

seven SMS for Vendure

Send transactional SMS for customer and order events from Vendure via the seven gateway.

MIT License Vendure 3.0+ TypeScript strict


Features

  • 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

Prerequisites

Installation

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.',
                },
            },
        }),
    ],
}

Configuration

SEVEN_API_KEY=your-seven-api-key
interface PluginInitOptions {
    apiKey: string
    events: {
        customerCreation?: { enabled: boolean; text: string }
        orderCreation?:    { enabled: boolean; text: string }
    }
}

Template variables

Placeholder Description
{{firstName}} Customer's first name
{{lastName}} Customer's last name
{{phoneNumber}} Customer's phone number
{{identifier}} Customer's email / login identifier

Development

npm run dev    # ts-node server + worker concurrently
npm run build  # compile TS to dist/
npm run start  # production server + worker

Troubleshooting

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}}

Support

Need help? Feel free to contact us or open an issue.

License

MIT

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Contributors