SMTP Channel Provider

Configuration

To configure the SMTP integration, you'll need the following data:

required fields are marked with an `*`
ParameterTypeDescription
portinteger *SMTP server port
usernamestring *SMTP authentication username
passwordstring *SMTP authentication password
fromobject *Default sender email address
└ emailstring *Sender email address
└ namestring Sender name
reply_toobject Reply-to email address
└ emailstring *Reply-to email address
└ namestring Reply-to name
securitystring SMTP security/encryption method
hoststring *SMTP server hostname

In the Dashboard

The easiest way to configure this integration is through the MagicBell dashboard:

  1. Log in to your MagicBell dashboard.
  2. Navigate to Channels.
  3. Find and click on this channel name in the sidebar.
  4. Click the Configure SMTP button.
  5. Follow the on-screen instructions to complete the configuration.

Using the API

Use the API to delete , save and list SMTP. For example, to save the integration:

Request
curl --request PUT \
  --url 'https://api.magicbell.com/v2/integrations/smtp' \
  --header 'content-type: application/json' \
  --header "authorization: Bearer $TOKEN" \
  --data '{"host":"smtp.gmail.com","port":587,"username":"user@example.com","password":"your-app-password","from":{"email":"notifications@example.com","name":"Example Notifications"},"reply_to":{"email":"support@example.com","name":"Example Support"},"security":"starttls"}'

Usage

1. When configured with

{
  "from": {
    "email": "notifications@example.com",
    "name": "Example Notifications"
  },
  "host": "smtp.gmail.com",
  "password": "your-app-password",
  "port": 587,
  "reply_to": {
    "email": "support@example.com",
    "name": "Example Support"
  },
  "security": "starttls",
  "username": "user@example.com"
}

2. With a channel token

{
  "address": "dan@example.com",
  "name": "Dan"
}

3. With Broadcast

{
  "action_url": "https://example.com",
  "category": "example",
  "content": "I come from broadcast",
  "custom_attributes": {},
  "id": "d1b3b3b3-3b3b-3b3b-3b3b-3b3b3b3b3b3b",
  "overrides": {},
  "recipients": [
    {
      "custom_attributes": {
        "plan": "enterprise",
        "preferred_pronoun": "They",
        "pricing_version": "v10"
      },
      "email": "test@example.com",
      "external_id": "83d987a-83fd034",
      "first_name": "Person",
      "last_name": "Doe",
      "phone_numbers": [
        "+1 5005550001"
      ]
    }
  ],
  "title": "Hello, World!",
  "topic": "example"
}

The channel handler triggers a HTTP request

POST smtp://smtp.gmail.com:587

With payload

{
  "Config": {
    "from": {
      "email": "notifications@example.com",
      "name": "Example Notifications"
    },
    "host": "smtp.gmail.com",
    "password": "your-app-password",
    "port": 587,
    "reply_to": {
      "email": "support@example.com",
      "name": "Example Support"
    },
    "security": "starttls",
    "username": "user@example.com"
  },
  "Message": "RnJvbTogRXhhbXBsZSBOb3RpZmljYXRpb25zIDxub3RpZmljYXRpb25zQGV4YW1wbGUuY29tPg0KVG86IERhbiA8ZGFuQGV4YW1wbGUuY29tPg0KUmVwbHktVG86IEV4YW1wbGUgU3VwcG9ydCA8c3VwcG9ydEBleGFtcGxlLmNvbT4NClN1YmplY3Q6IEhlbGxvLCBXb3JsZCENCk1JTUUtVmVyc2lvbjogMS4wDQpDb250ZW50LVR5cGU6IG11bHRpcGFydC9hbHRlcm5hdGl2ZTsgYm91bmRhcnk9ImJvdW5kYXJ5Ig0KDQotLWJvdW5kYXJ5DQpDb250ZW50LVR5cGU6IHRleHQvcGxhaW47IGNoYXJzZXQ9IlVURi04Ig0KDQpJIGNvbWUgZnJvbSBicm9hZGNhc3QNCi0tYm91bmRhcnkNCkNvbnRlbnQtVHlwZTogdGV4dC9odG1sOyBjaGFyc2V0PSJVVEYtOCINCg0KSSBjb21lIGZyb20gYnJvYWRjYXN0DQotLWJvdW5kYXJ5LS0NCg==",
  "Payload": {
    "from": {
      "email": "notifications@example.com",
      "name": "Example Notifications"
    },
    "html_body": "I come from broadcast",
    "reply_to": {
      "email": "support@example.com",
      "name": "Example Support"
    },
    "subject": "Hello, World!",
    "text_body": "I come from broadcast",
    "to": {
      "email": "dan@example.com",
      "name": "Dan"
    }
  }
}