Send an email

This query sends an email as text content, and an email as HTML content.

mutation SendEmail {
sendTextEmail: _sendEmail(
input: {
from: {
email: "from@email.com"
name: "Me myself"
}
replyTo: "replyTo@email.com"

to: "target@email.com"
cc: ["cc1@email.com", "cc2@email.com"]
bcc: ["bcc1@email.com", "bcc2@email.com", "bcc3@email.com"]

subject: "Email with text content"
messageAs: {
text: "Hello world!"
}
}
) {
status
errors {
__typename
...on ErrorPayload {
message
}
}
}

sendHTMLEmail: _sendEmail(
input: {
to: "target@email.com"
subject: "Email with HTML content"
messageAs: {
html: "<p>Hello world!</p>"
}
}
) {
status
errors {
__typename
...on ErrorPayload {
message
}
}
}
}

Extensions required for this query permalink

  1. Email Sender permalink

    Send emails via global mutation "_sendEmail".

Bundles containing all extensions required for this query permalink

  1. “All in One Toolbox for WordPress” Bundle permalink

    Achieve all superpowers: All of Gato GraphQL extensions, in a single plugin

  2. “Better WordPress Webhooks” Bundle permalink

    Easily create webhooks to process incoming data from any source or service using advanced tools, directly within the wp-admin

  3. “Private GraphQL Server for WordPress” Bundle permalink

    Use GraphQL to power your application (blocks, themes and plugins), internally fetching data without exposing a public endpoint

  4. “Tailored WordPress Automator” Bundle permalink

    Create workflows to automate tasks (to transform data, automatically caption images, send notifications, and more)

  5. “Unhindered WordPress Email Notifications” Bundle permalink

    Send personalized emails to all your users, and notifications to the admin, without constraints on what data can be added to the email

Tutorial lessons explaining how the query works permalink