api_key = $api_key; parent::__construct( $this->base_url ); } /** * Prepares Header for Request * * @since 3.2.0 * @version 1.0 */ private function get_headers() { return array( 'Authorization' => 'Bearer ' . $this->api_key, 'Content-Type' => 'application/json' ); } /** * Sends Email using Resend emails endpoint * * @param $content * @since 3.2.0 * @version 1.0 */ public function send( $content ) { $content = json_encode( $content ); return $this->request( 'POST', '/emails', $this->get_headers(), $content, $this->email_sent_code ); } }