# Send email messages with custom domain

This endpoint allows you to send email messages using your custom domain settings. You need a custom domain settings ID (which you can get from Email settings (opens new window)) and optionally a custom sender ID (from Sender settings (opens new window)).

HTML is allowed within email message content. For example, you can set the content as:

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

The email message will be displayed as:

Hi user, enjoy our product!

POST /emails/send-custom-domain/

Attribute Type Required Description
api_email_settings/campaign integer yes The unique identifier of your custom domain settings or campaign automatically generated by User.com.
author integer / string yes The unique identifier of an email author (string) or author ID (integer).
content string yes The content of your email message (HTML allowed).
custom_sender integer no The unique identifier of your custom sender (optional).
receivers string yes A comma-separated list of user IDs.
subject string yes The subject line for your email message.
template integer no The unique identifier of the email template.

If you want to use an existing email campaign, pass your email campaign ID as the value in the request body. Note that your email campaign must be created as a simple type and must be active.

The author parameter determines who appears as the sender of this email - it can be the 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": 123,
    "custom_sender": 456,
    "subject": "Welcome to Our Platform",
    "content": "Hello! Welcome to our platform. \<a href='\''https://example.com/dashboard'\''>Access your dashboard\</a>",
    "receivers": "1001,1002,1003",
    "template": 789,
    "author": "support@yourcompany.com"
}' "https://<your_app_subdomain>.user.com/api/public/emails/send-custom-domain/"

# Response

{
  "campaign": 880
}

This response indicates that the email has been sent successfully. The returned value is the email campaign ID that was created for this send operation.