CRM V2

SingleOptin extends CrmClientModel
in package

This class allows to handle single optins

Tags
throws
ApiErrorException

If an error occurs

throws
CrmException

If the CRM encounters an error

category

Api Models

subpackage

models

author

Jérémy Munsch jeremy.munsch@ldc.fr

Table of Contents

$validation  : array<string|int, mixed>
Validation rules
setStatus()  : bool
Set the single optin status for an email

Properties

$validation

Validation rules

protected static array<string|int, mixed> $validation = ['email' => 'required|email', 'opt_in' => 'required|bool']

Methods

setStatus()

Set the single optin status for an email

public static setStatus(string $email, bool $opt_in) : bool
Parameters
$email : string
$opt_in : bool
Tags
throws
ValidationException

If a field email could not be validated.

throws
CrmException

If an error occurs on server side or on getting response.

throws
ApiErrorException

If any error or \LDC\LDCCRM\Enums\ApiError occurs. Possibles are : - singleOptinCustomerExists, If a customer exists with this email.

phpcs:ignore

Squiz.Commenting.FunctionCommentThrowTag.WrongNumber

Return values
bool —

true if succeeded

Search results