45 $token = $this->settings[
"serviceUserToken"];
48 curl_setopt_array($curl, array(
49 CURLOPT_URL => $this->settings[
"domain"] .
"/v2beta/users/$this->userid/email",
50 CURLOPT_RETURNTRANSFER =>
true,
51 CURLOPT_ENCODING =>
'',
52 CURLOPT_MAXREDIRS => 10,
54 CURLOPT_FOLLOWLOCATION =>
true,
55 CURLOPT_CUSTOMREQUEST =>
'POST',
56 CURLOPT_POSTFIELDS =>
"{
57 \"email\": \"$email\",
60 CURLOPT_HTTPHEADER => array(
61 "Content-Type: application/json",
62 "Accept: application/json",
63 "Authorization: Bearer $token"
67 $response = json_decode(curl_exec($curl));
69 if(isset($response->code)) {
70 throw new Exception(
"Error-Code: " . $response->code .
" Message: " . $response->message);
72 $this->returnedVerificationCode = $response->verificationCode;
82 $token = $this->settings[
"serviceUserToken"];
83 curl_setopt_array($curl, array(
84 CURLOPT_URL => $this->settings[
"domain"] .
"/v2beta/users/$this->userid/email/resend",
85 CURLOPT_RETURNTRANSFER =>
true,
86 CURLOPT_ENCODING =>
'',
87 CURLOPT_MAXREDIRS => 10,
89 CURLOPT_FOLLOWLOCATION =>
true,
90 CURLOPT_CUSTOMREQUEST =>
'POST',
91 CURLOPT_POSTFIELDS =>
'{
94 CURLOPT_HTTPHEADER => array(
95 "Content-Type: application/json",
96 "Accept: application/json",
97 "Authorization: Bearer $token"
101 $response = json_decode(curl_exec($curl));
102 if(isset($response->code)) {
103 throw new Exception(
"Error-Code: " . $response->code .
" Message: " . $response->message);
105 $this->returnedVerificationCode = $response->verificationCode;
114 public function verify(
string $verifyCode): bool {
115 $token = $this->settings[
"serviceUserToken"];
118 curl_setopt_array($curl, array(
119 CURLOPT_URL => $this->settings[
"domain"] .
"/v2beta/users/$this->userid/email/verify",
120 CURLOPT_RETURNTRANSFER =>
true,
121 CURLOPT_ENCODING =>
'',
122 CURLOPT_MAXREDIRS => 10,
123 CURLOPT_TIMEOUT => 0,
124 CURLOPT_FOLLOWLOCATION =>
true,
125 CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
126 CURLOPT_CUSTOMREQUEST =>
'POST',
127 CURLOPT_POSTFIELDS =>
"{
128 \"verificationCode\": \"$verifyCode\"
130 CURLOPT_HTTPHEADER => array(
131 "Content-Type: application/json",
132 "Accept: application/json",
133 "Authorization: Bearer $token"
137 $response = curl_exec($curl);
139 if(isset($response->code)) {