Use your own email provider
You can integrate popular SaaS email providers using the Phosphor API, enabling you to specify both the from
and reply-to
fields in the format <email_address>
or name <email_address>
.
Create a configuration
Create a new configuration by issuing a POST
request to the email-integrations
endpoint.
Only one email provider configuration is allowed per organization.
If you previously set up a custom email provider, before creating a new integration, you must delete the old one.
POST https://admin-api.phosphor.xyz/v1/email-integrations
The payload has the following format:
{
"provider": "MAILGUN" | "AMAZON_SES" | "CUSTOM_SMTP",
"config": {}
}
The information needed in the config
object differs by the email provider.
- Mailgun
- Amazon SES
- Custom SMTP servers
{
"config": {
"email_from": "Your Org <hello@your-org.com>",
"email_reply_to": "help@your-org.com",
"domain": "your-org.com",
"api_key": "api-key",
"region": "US" | "EU",
},
"provider": "MAILGUN",
}
{
"config": {
"email_from": "Your Org <hello@your-org.com>",
"email_reply_to": "help@your-org.com",
"smtp_username": "smtp-username",
"smtp_password": "smtp-password",
"region": "us-west-1",
"port": 587 | null
},
"provider": "AMAZON_SES",
}
{
"config": {
"email_from": "Your Org <hello@gmail.com>",
"email_reply_to": "help@gmail.com",
"username": "username",
"password": "password",
"host": "smtp.gmail.com",
"port": 587 | null
},
"provider": "CUSTOM_SMTP",
}
Edit a configuration
Edit an existing configuration by issuing a PATCH
request to the email-integrations
endpoint.
PATCH https://admin-api.phosphor.xyz/v1/email-integrations/{integration_id}
You can pass any parameters that were originally specified in your integration config
, such as:
{
"email_from": "New Org <hello@new-org.com>"
}
Delete a configuration
Delete an existing configuration by issuing a DELETE
request to the email-integrations
endpoint.
DELETE https://admin-api.phosphor.xyz/v1/email-integrations/{integration_id}