Documentation

GetByEmail

CSubcription::GetByEmail(
    $email
);

The method GetByEmail returns a subscription by the unique e-mail address.

Parameters

ParameterDescription
$email The subscriber's unique e-mail address.

Return Values

Returns an instance of the CDBResult class. The fields of the Subscription object become available after calling one of the CDBResult methods.

Example



//new or existing subscription?
//ID==0 indicates new subscription
if(strlen($sf_EMAIL) > 0 || $ID > 0)
{
    if($ID > 0)
        $subscription = CSubscription::GetByID($ID);
    else
        $subscription = CSubscription::GetByEmail($sf_EMAIL);

    if($subscription->ExtractFields("str_"))
        $ID = (integer)$str_ID;
    else
        $ID=0;
}
else
    $ID = 0;
© «Bitrix24», 2001-2024