diff --git a/src/Appwrite/Auth/Phone/Msg91Flow.php b/src/Appwrite/Auth/Phone/Msg91Flow.php new file mode 100644 index 0000000000..2ada52c406 --- /dev/null +++ b/src/Appwrite/Auth/Phone/Msg91Flow.php @@ -0,0 +1,46 @@ + utilized from for flow id + * @param string $to + * @param string $message + * @return void + */ + public function send(string $from, string $to, string $message): void + { + $to = ltrim($to, '+'); + $this->request( + method: 'POST', + url: $this->endpoint . '/messages', + payload: \http_build_query([ + 'sender' => $this->user, + 'otp' => $message, + 'flow_id' => $from, + 'mobiles' => $to + ]), + headers: [ + "content-type: application/JSON", + "authkey: {$this->secret}", + ] + ); + } +}