Sunday, June 2, 2019

Web Services (SuiteTalk) : PHP Toolkit 2012.2 and above > Change Email

Use the changeEmail operation to change a user's email. Below is a sample code demonstration how to change password using PHP Toolkit 2012.2 and above.

Sample Code (PHP Toolkit 2012.2 and above)

<!--phprequire_once '../PHPToolkit/NetSuiteService.php';$service = new NetSuiteService();$changeEmail = new ChangeEmail();$changeEmail--->currentPassword = 'xxxxxx';$changeEmail->newEmail = "test@email.com";$changeEmail->newEmail2 = "test@email.com";$changeEmail->justThisAccount = true;$changeEmailRequest = new ChangeEmailRequest();$changeEmailRequest->changeEmail = $changeEmail;$response = $service->changeEmail($changeEmailRequest);if($response->sessionResponse->status->isSuccess){ echo "Your Email has been Successfully CHANGED";}else{ $statusDetails = $response->sessionResponse->status->statusDetail; foreach($statusDetails as $statusDetail) { echo $statusDetail->code; echo $statusDetail->type .": " . $statusDetail->message; }}

No comments:

Post a Comment