Gato GraphQL logo

Email Sender

Email Sender

Addition of mutation _sendEmail to the GraphQL schema, to send emails via WordPress wp_mail function.

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