Skip to main content
This section describes the available actions in the Newsletter area. Using these actions, customers can subscribe to the newsletter, confirm their subscription, unsubscribe again, or have their email address blocked from receiving newsletters.

Actions overview


Actions

NewsletterSubscribe

This action subscribes a customer to the newsletter. After successful subscription, the customer receives a confirmation email with a double opt-in link. Usage example
Can be used on a newsletter subscription page where customers can enter their email address and optionally select one or more target groups.
Parameters Error codes Related modules, variables & methods Example showing how a customer selects their email address and optionally target groups to subscribe to the newsletter, including success output after the subscription.

NewsletterSubscribeConfirm

This action confirms the newsletter subscription via double opt-in. After subscribing, the customer receives an email with a confirmation link that triggers this action. For a regular subscription, the action either creates a new subscriber or adds the selected target groups to an existing subscriber with the same email address. The address is then removed from the blacklist and the welcome email is sent. Usage example
Can be used on the confirmation page to which the customer is redirected after clicking the opt-in link in the subscription email.
Confirming a changed email address If a subscriber’s email address is changed via PUT newsletter/subscriber/{id}, the new address also receives an email with the token confirmSubscribeNewsletter. This token additionally contains the parameter subscriberId with the ID of the existing subscriber. If the token contains a subscriberId, no new subscriber is created. Instead, the confirmed email address is assigned to the existing subscriber: Tokens without a subscriberId, for example from a subscription via the NewsletterSubscribe function or from emails sent before this parameter was introduced, continue to be processed like regular subscriptions. Error codes The error texts are maintained in actions.newsletterSubscribe. Related modules, variables & methods Example showing how a success message is displayed after successful confirmation and an error notice appears in the event of an invalid token.

NewsletterUnsubscribe

This action unsubscribes a customer from the newsletter. The customer specifies their email address and can optionally deselect individual target groups. Usage example
Can be used on the unsubscribe page, where customers can enter their email address and unsubscribe from individual or all newsletter target groups.
Parameters Error codes Related modules, variables & methods Example showing how a customer enters their email address and unsubscribes from individual target groups, including success output.

NewsletterUnsubscribeConfirm

This action confirms the newsletter unsubscription via double opt-in. After unsubscribing, the customer receives an email with a confirmation link that triggers this action. Usage example
Can be used on the confirmation page to which the customer is redirected after clicking the opt-in link in the unsubscription email.
Error codes The error texts are maintained in actions.newsletterUnsubscribe. Related modules, variables & methods Example showing how a success message is displayed after successful confirmation of the unsubscription and an error notice appears in the event of an invalid token.

BlacklistAdd

This action adds an email address to the blacklist (block list). The shop does not send newsletters to addresses on this list. The block applies to all subshops and all target groups. Whether the owner of the address must confirm the entry is controlled by the parameter blacklistSelfDoubleOptIn in newsletter.newsletter:
  • blacklistSelfDoubleOptIn inactive: The address is added to the blacklist immediately.
  • blacklistSelfDoubleOptIn active: The shop sends the email from newsletter.newsletter → doubleOptInEmailBlacklist with an opt-in link to the address. Only the confirmation with BlacklistAddConfirm adds the address to the blacklist. In the email template, you generate the link with the token name confirmBlacklistAdd, see $wsOptIn.
In both cases, the action reports success as soon as the input is valid. Usage example
Can be used on a page where customers can permanently exclude their email address from receiving newsletters.
Parameters Error codes The error texts come from actions.newsletterSubscribe. Related modules, variables & methods Example showing how a customer enters their email address to have it added to the blacklist, including success output.

BlacklistAddConfirm

This action confirms the entry of an email address in the blacklist via double opt-in. The action takes the email address from the opt-in token and adds it to the blacklist. Usage example
Can be used on the confirmation page to which the customer is redirected after clicking the opt-in link in the email from BlacklistAdd.
Error codes The error texts are maintained in actions.blacklistAdd. Related modules, variables & methods Example showing how a success message is displayed after successful confirmation and an error notice appears in the event of an invalid token.