Skip to content

Common APIs

Base path: /api/common

Send Email

http
POST /api/common/send-email

Sends an HTML email through the configured email service.

Body

json
{
  "to": "recipient@example.com",
  "subject": "Welcome",
  "html": "<p>Hello from Core API.</p>"
}
FieldTypeRequired
tostringYes
subjectstringYes
htmlstringYes

Blank or missing fields return 400.

Environment

The endpoint sends mail through Nodemailer using SMTP bindings.

BindingRequiredNotes
SMTP_HOSTYesSMTP server host.
SMTP_PORTNoDefaults to 587.
SMTP_USERNoUsed for SMTP auth when paired with SMTP_PASS.
SMTP_PASSNoUsed for SMTP auth when paired with SMTP_USER.
SMTP_SECURENoSet to true for secure SMTP. Defaults to true when SMTP_PORT is 465; otherwise false.
EMAIL_FROMYesSender address.

Response

json
{
  "success": true,
  "message": "Email sent successfully",
  "data": {
    "messageId": "<message-id>",
    "accepted": [
      "recipient@example.com"
    ],
    "rejected": [],
    "response": "250 Message accepted"
  }
}

Missing SMTP configuration or provider failures return 500.