CustomerNewsletterService

This service class contains functions used for handling newsletter related tasks.
All public functions are available in the Twig template renderer.

Namespace

IO\Services

Properties
Type Name Description

NewsletterRepositoryContract

$newsletterRepo

Methods
public __construct($newsletterRepo)

CustomerNewsletterService constructor.

Parameters

Type

Name

Description

NewsletterRepositoryContract

$newsletterRepo

public saveNewsletterData($email, $emailFolder, $firstName = "", $lastName = "")

Subscribes a single user to a newsletter

Parameters

Type

Name

Description

string

$email

The email address of the customer

int

$emailFolder

Id for the type of newsletter

string

$firstName

Optional: First name of the customer

string

$lastName

Optional: Last name of the customer

public saveMultipleNewsletterData($email, $emailFolders, $firstName = "", $lastName = "")

Subscribes a single user to multiple newsletters

Parameters

Type

Name

Description

string

$email

The email address of the customer

array

$emailFolders

Ids for the types of newsletters

string

$firstName

Optional: First name of the customer

string

$lastName

Optional: Last name of the customer

public updateOptInStatus($authString, $newsletterEmailId):bool
Parameters

Type

Name

Description

string

$authString

Authorization string used for security purposes

int

$newsletterEmailId

Unique id of the newsletter registration

public deleteNewsletterDataByEmail($email, $emailFolder):bool

Delete recipients from the newsletter Not passing the optional parameter $emailFolder deletes the recipient from all email-folders

Parameters

Type

Name

Description

string

$email

Email of the user

int

$emailFolder

Id of the type of newsletter