composeEmail
Requires permission sales:quote:update.
Composes and sends a new email about a quote to every To and Cc address given. For now a new email must be tied to a quote: without one the call comes back unsuccessful with a message instead of sending. The result carries success, a message and the email's IDs. Requires permission to update quotes.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation ComposeEmail($input: ComposeEmailInput!) {
composeEmail(input: $input) {
emailActivityId
error
message
messageId
replyToAddress
success
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation ComposeEmail($input: ComposeEmailInput!) {\n composeEmail(input: $input) {\n emailActivityId\n error\n message\n messageId\n replyToAddress\n success\n }\n}",
"variables": {
"input": {
"bodyHtml": "string",
"subject": "string",
"toEmails": [
"string"
]
}
}
}
EOF
Variables:
{
"input": {
"bodyHtml": "string",
"subject": "string",
"toEmails": [
"string"
]
}
}
Response:
{
"data": {
"composeEmail": {
"emailActivityId": "string",
"error": "string",
"message": "string",
"messageId": "string",
"replyToAddress": "string",
"success": true
}
}
}
composeEmail(
input: ComposeEmailInput!
): SendEmailResult!
Arguments
composeEmail.input ● ComposeEmailInput! non-null input
The To and Cc addresses, subject, body, and the quote reference type and ID.
Type
SendEmailResult object
The result of sending an email.