use constants for subscriptions

This commit is contained in:
2025-01-03 09:33:08 +01:00
parent 395d6c3b2e
commit cc3814bbcd
3 changed files with 35 additions and 25 deletions

View File

@ -22,6 +22,15 @@ use GuzzleHttp\RequestOptions;
class SubscriptionProcess extends Model
{
public const LISTID = 'listid';
public const NAME = 'name';
public const PENDINGURL = 'pendingurl';
public const THANKYOUURL = 'thankyouurl';
public const USE_SINGLE_OPTIN = 'usesingleoptin';
public const RESEND_CONFIRMATION_EMAIL = 'resendconfirmationemail';
public const USE_CHANGE_EMAIL = 'usechangeemail';
public const PARAM_EMAIL = 'email';
/**
* @throws BaseException
*/
@ -58,7 +67,7 @@ class SubscriptionProcess extends Model
'list.json',
[
RequestOptions::FORM_PARAMS => array_filter([
'name' => trim($name ?? ''),
self::NAME => trim($name ?? ''),
]),
]
);
@ -77,7 +86,7 @@ class SubscriptionProcess extends Model
'list/'.urlencode(trim($listId)).'.json',
[
RequestOptions::FORM_PARAMS => array_filter([
'name' => trim($name ?? ''),
self::NAME => trim($name ?? ''),
]),
]
)
@ -95,8 +104,8 @@ class SubscriptionProcess extends Model
'list/redirect.json',
[
RequestOptions::FORM_PARAMS => [
'listid' => trim($listId),
'email' => trim($email),
self::LISTID => trim($listId),
self::PARAM_EMAIL => trim($email),
],
]
)