Bitrix Site Manager

CSubscription::GetUserSubscription

CSubscription::GetUserSubscription();

The method GetUserSubscription returns an array containing fields of the current user subscription. The subscription is identified by the e-mail stored in the visitor cookie or by the authorized user e-mail.

Parameters

No parameters.

Return Values

Returns an array containing the Subscription object fields. If the visitor's subscription could not be found, the array array("ID"=>0, "EMAIL"=>"") is returned.

Example



//get current user subscription from cookies
$aSubscr = CSubscription::GetUserSubscription();

//get user's newsletter categories
$aSubscrRub = CSubscription::GetRubricArray(intval($aSubscr["ID"]));

//show subscription form
//.....