Mutations
sendNewEmail
Sends a new outbound email to a customer, creating a new thread by default. Use threadId to attach the email to an existing thread instead. Supports CC and BCC recipients (up to 49 combined), file attachments, and an optional alternate from address. Requires the email:create and email:read permissions.
MUTATION
sendNewEmail(input: SendNewEmailInput!): SendNewEmailOutput!Arguments
input
required
Returns
email
error
Mutation
mutation SendNewEmail($input: SendNewEmailInput!) {
sendNewEmail(input: $input) {
email {
id
thread {
id
ref
customer {
__typename
}
title
description
previewText
}
customer {
id
externalId
fullName
shortName
email {
__typename
}
avatarUrl
}
inReplyToEmailId
from {
name
email
emailActor {
__typename
... on CustomerEmailActor {
__typename
}
}
}
to {
name
email
emailActor {
__typename
... on CustomerEmailActor {
__typename
}
}
}
}
error {
message
type
code
fields {
field
message
type
}
}
}
}Variables
{
"input": {
"customerId": "id",
"subject": "string",
"textContent": "string"
}
}Response
{
"data": {
"sendNewEmail": {
"email": {
"id": "id",
"thread": {
"id": "id",
"ref": "string",
"customer": {
"__typename": "Customer"
},
"title": "string",
"description": "string",
"previewText": "string"
},
"customer": {
"id": "id",
"externalId": "id",
"fullName": "string",
"shortName": "string",
"email": {
"__typename": "EmailAddress"
},
"avatarUrl": "string"
},
"inReplyToEmailId": "id",
"from": {
"name": "string",
"email": "string",
"emailActor": {
"__typename": "CustomerEmailActor"
}
},
"to": {
"name": "string",
"email": "string",
"emailActor": {
"__typename": "CustomerEmailActor"
}
}
},
"error": {
"message": "string",
"type": "VALIDATION",
"code": "string",
"fields": [
{
"field": "string",
"message": "string",
"type": "VALIDATION"
}
]
}
}
}
}Was this page helpful?
⌘I
Mutation
mutation SendNewEmail($input: SendNewEmailInput!) {
sendNewEmail(input: $input) {
email {
id
thread {
id
ref
customer {
__typename
}
title
description
previewText
}
customer {
id
externalId
fullName
shortName
email {
__typename
}
avatarUrl
}
inReplyToEmailId
from {
name
email
emailActor {
__typename
... on CustomerEmailActor {
__typename
}
}
}
to {
name
email
emailActor {
__typename
... on CustomerEmailActor {
__typename
}
}
}
}
error {
message
type
code
fields {
field
message
type
}
}
}
}Variables
{
"input": {
"customerId": "id",
"subject": "string",
"textContent": "string"
}
}Response
{
"data": {
"sendNewEmail": {
"email": {
"id": "id",
"thread": {
"id": "id",
"ref": "string",
"customer": {
"__typename": "Customer"
},
"title": "string",
"description": "string",
"previewText": "string"
},
"customer": {
"id": "id",
"externalId": "id",
"fullName": "string",
"shortName": "string",
"email": {
"__typename": "EmailAddress"
},
"avatarUrl": "string"
},
"inReplyToEmailId": "id",
"from": {
"name": "string",
"email": "string",
"emailActor": {
"__typename": "CustomerEmailActor"
}
},
"to": {
"name": "string",
"email": "string",
"emailActor": {
"__typename": "CustomerEmailActor"
}
}
},
"error": {
"message": "string",
"type": "VALIDATION",
"code": "string",
"fields": [
{
"field": "string",
"message": "string",
"type": "VALIDATION"
}
]
}
}
}
}
