Shopware 6: Usage
Log in to the frontend of your Shopware shop.
Account
The standard "Subscribe to newsletter" checkbox is overwritten by the one from emma. You can change the label yourself using the text snippets.
Resources/views/storefront/page/account/index.html.twig
{% block page_account_overview_newsletter %}
Export via console
To transfer changes to Shopware records to emma, please create a cron job that runs the command "mailingwork:export" at the interval you want. Optionally, you can transfer only customers with a valid opt-in. This starts an import in emma, which you can view under "Subscribers ⭢ Import".
Parameters
- --forceOptin with the options "true" or "false" defines whether all customers or only customers with a valid opt-in are transferred
- --salesChannel with the "salesChannelID" restricts the transfer to the salesChannel you want (recommended)
Example
- ./bin/console mailingwork:export --salesChannel 3ec263d2cfd845e78c27123a919f53f7 --forceOptin true
Multilingual support
For opt-in and opt-out forms, there is no reference to the customer yet, because the customer is not registered yet. In this case, the SalesChannel and the active language are used. Since content can be stored per language, please create one subscription form in Shopware and one opt-in setup in emma for each language. In each setup, set the language as a hidden field. Alternatively, you can have Shopware transfer the language as a hidden field using the block {% block element_mwform_subscribe_form_inner %}. You can use this value to select the language after the subscriber has subscribed. In the customer account and in the customer export, the customer's language is used (customer.language.local.code), for example de-DE
