쿼리 라이브러리
쿼리 라이브러리관리자에게 이메일 보내기

관리자에게 이메일 보내기

이 쿼리는 WordPress의 wp_options 테이블에서 관리자 사용자의 이메일 주소를 가져와, 해당 값을 to 필드에 주입합니다.

query ExportData {
  adminEmail: optionValue(name: "admin_email")
    @export(as: "adminEmail")
}
 
mutation SendEmailToAdmin @depends(on: "ExportData") {
  _sendEmail(
    input: {
      to: $adminEmail
      subject: "Admin notification"
      messageAs: {
        html: "There is a new post on the site, go check!"
      }
    }
  ) {
    status
  }
}