SMTP Mutations

CreateSmtp

Create an SMTP configuration

Parameters

input - SmtpInput
Data of the SMTP configuration

Example

mutation CreateSmtp($input: SmtpInput!) {
  CreateSmtp(input: $input) {
    id
    email
    host
    port
    active
    created_at
    user_profile_id
  }
}
{
  "input": {
    "email": "[email protected]",
    "password": "******",
    "host": "smtp.example.com",
    "port": 587,
    "active": true
  }
}

Returned data

{
  "data": {
    "CreateSmtp": {
      "id": 100045,
      "email": "[email protected]",
      "host": "smtp.example.com",
      "port": 587,
      "active": true,
      "created_at": "2025-01-01T00:00:00Z",
      "user_profile_id": 42
    }
  }
}

UpdateSmtp

Update an SMTP configuration

Parameters

id - ID
Id of the SMTP configuration
input - SmtpInput
Data of the SMTP configuration

Example

mutation UpdateSmtp($id: ID!, $input: SmtpInput!) {
  UpdateSmtp(id: $id, input: $input) {
    id
    email
    host
    port
    active
    created_at
    user_profile_id
  }
}
{
  "id": 100045,
  "input": {
    "email": "[email protected]",
    "password": "******",
    "host": "smtp.example.com",
    "port": 465,
    "active": false
  }
}

Returned data

{
  "data": {
    "UpdateSmtp": {
      "id": 100045,
      "email": "[email protected]",
      "host": "smtp.example.com",
      "port": 465,
      "active": false,
      "created_at": "2025-01-03T00:00:00Z",
      "user_profile_id": 42
    }
  }
}

DisableSmtp

Disable an SMTP configuration

Parameters

id - ID
Id of the SMTP configuration

Example

mutation DisableSmtp($id: ID!) {
  DisableSmtp(id: $id) {
    id
    email
    active
  }
}
{
  "id": 100045
}

Returned data

{
  "data": {
    "DisableSmtp": {
      "id": 100045,
      "email": "[email protected]",
      "active": false
    }
  }
}

EnableSmtp

Enable an SMTP configuration

Parameters

id - ID
Id of the SMTP configuration

Example

mutation EnableSmtp($id: ID!) {
  EnableSmtp(id: $id) {
    id
    email
    active
  }
}
{
  "id": 100045
}

Returned data

{
  "data": {
    "EnableSmtp": {
      "id": 100045,
      "email": "[email protected]",
      "active": true
    }
  }
}

SendEmail

Send an email for a document

Parameters

email - EmailInput
Email payload

Example

mutation SendEmail($email: EmailInput!) {
  SendEmail(email: $email)
}
{
  "email": {
    "document_id": 100001,
    "document_type": "INVOICE",
    "to": ["[email protected]"],
    "bcc": ["[email protected]"],
    "cc": ["[email protected]"],
    "object": "Invoice #100001",
    "body": "Please find your invoice attached.",
    "attachments": []
  }
}

Returned data

{
  "data": {
    "SendEmail": true
  }
}

SendTestEmail

Send a test email to verify SMTP configuration

Parameters

to - String
Recipient email address

Example

mutation SendTestEmail($to: String!) {
  SendTestEmail(to: $to)
}
{
  "to": "[email protected]"
}

Returned data

{
  "data": {
    "SendTestEmail": true
  }
}

SmtpInput data type

email - String
SMTP account email address
password - String
SMTP account password
host - String
SMTP server hostname
port - Int
SMTP server port
active - Boolean
If true, the SMTP configuration is active

EmailInput data type

document_id - ID
Document identifier
document_type - String
Document type (e.g., INVOICE)
to - [String]
Recipients
bcc - [String]
Blind carbon copy recipients
cc - [String]
Carbon copy recipients
object - String
Email subject
body - String
Email body
attachments - [FileInput]
List of attachments