# Send email messages with custom domain

This endpoint allows you to send email messages using your custom settings.
All you need is custom domain settings id, and optionally custom sender id.

HTML is allowed inside of email message content. For example, as a content we can set:

Hi <b>user</b>, enjoy our product!

The email message will be shown as follow:

Hi user, enjoy our product!

POST /emails/send-custom-domain/

Attributes Type Required Description
api_email_settings/campaign integer yes A unique identifier of your SMTPSettings or Campaign automatically generated by User.com.
author integer / string yes An unique identifier of an email (string) or ID (integer) of an author.
content string yes A content of your email message.
custom_sender (optional) integer no A unique identifier of your Custom Sender.
receivers string yes A list of user ids separated by commas.
subject string yes A subject for your email message.
template integer yes An email template unique identifier.

If you want to use existing email campaign, in the body of your request pass your email campaign id as a value. Remember that your email campaign has to be created as a simple type and it's still active.

Author can determine who's the sender of this email, it can be owner or any agent of the app.

# Request

  • CURL
  • JavaScript
  • PHP
  • Python
 curl -X POST -H "Authorization: Token <your_64_char_api_key>"
     -H "Accept: */*; version=2" -H "Content-Type: application/json" -d '{
    "api_email_settings": "1",
    "custom_sender": "1",
    "subject": "Email sent using API",
    "content": "This is content for email sent using API \<a href='\''http://example.org/'\''>link\</a>",
    "receivers": "5380718",
    "template": 1,
    "author": "johndoe@example.org"
}' "https://<your_app_subdomain>.user.com/api/public/emails/send-custom-domain/"

# Response

{
  "campaign": 880
}

This response means that the email has been sent correctly. Email campaign ID is returned as a value.