You are here

function zoomapi_api_update_user_email in Zoom API 7.2

Update Zoom user email.

@todo "Domain name doesn't match, please contact Zoom customer support to set managed domains for your account"

1 call to zoomapi_api_update_user_email()
zoomapi_update_user_email in ./zoomapi.module
Update Zoom user email.

File

./zoomapi.api.inc, line 140
API callbacks for Zoom API module.

Code

function zoomapi_api_update_user_email($zoom_user_id, $email) {
  try {
    $zoom_client = zoomapi_client();
    $zoom_client
      ->api('user')
      ->email($zoom_user_id, $email);
    db_update('zoomapi_users')
      ->fields([
      'zoom_email' => $email,
    ])
      ->condition('zoom_user_id', $zoom_user_id)
      ->condition('realm', zoomapi_realm())
      ->execute();
    return TRUE;
  } catch (\Exception $e) {
    watchdog(__FUNCTION__, 'Unable to update zoom email to @email for zoom account @id. Error: @e', [
      '@e' => $e
        ->getMessage(),
      '@email' => $email,
    ], WATCHDOG_CRITICAL);
    return FALSE;
  }
}