Users can sign up for Maileon newsletters by checking the checkbox on the checkout page. Users who haven’t checked this checkbox will also be created in Maileon, however they will not have any permissions. This is due to the fact that the user needs to exist in order for Maileon to send transactional emails.
The user creation process can be hooked into vie the wc_maileon_checkout_contact
and wc_maileon_create_contact_params
WordPress filter hooks.
wc_maileon_checkout_contact
Description
wc_maileon_checkout_contact
is a filter applied to a contact created on the checkout page.
Parameters
$contact
(Maileon\Contacts\Contact
) (required) The contact to be filtered
$user_id
(integer
) The ID of the user
$newsletter
(boolean
) Whether the user opted in to recieve newsletters
wc_maileon_create_contact_params
Description
wc_maileon_create_contact_params
is a filter applied to any contact creation Maileon API calls. The hook receives an array of parameters that are passed to the Maileon API. The array contains the following elements:
Parameters
contact
(Maileon\Contacts\Contact
) (required) The contact to be created
syncMode
(Maileon\Contacts\SynchronizationMode
) The synchronization mode
src
(string
) Subscription source
subscriptionPage
(string
) Subscription page
doi
(boolean
) Start doi process
doiPlus
(boolean
) Enable doi plus
doiMailingKey
(string
) The doi mailing key