User Experience
The consent popup workflow
When the user logs in the extension checks if the user should be prompted for consent and if the user has provided a valid UserProfileEmailAddress. If not null or empty, the extension checks if the email address is already registered in MailChimp, if it is then the extension stores the information that the user should not be prompted again. This is to ensure only one user in Storefront can affect the settings for any single email address. The extension always logs, regardless of debug settings, when it finds an email address that already exists in MailChimp and the fact it will no longer prompt this user. The check in Mailchimp is only made once, the first time in the session without having previously given consent. If the email address is not found in MailChimp, the following popup is displayed to the user:

The extension requires one of the options to be selected. Upon saving the extension stores the info about consent provided or rejected locally and also it adds the contact to MailChimp. When creating the contact, the following Storefront properties and fields in storefront are populated in the Mailchimp audience: UserProfileEmailAddress is mapped to the EMAIL merge field.UserProfileFirstName is mapped to the FNAME merge field.UserProfileLastName is mapped to the LNAME merge field.The deployment name is added as a Tag. This will help if contacts ever need to be removed or edited en-masse such as a customer wishing to revoke access for all its userbase.Whether the user is an administrator is mapped to the “Permission” group/interest category in MailChimp. If the user does not have administrator permission they are added to the “User” group/interest category, while if the user has both administrator and user permissions, they should instead be added to the “Administrator” group/interest. Administrators who are not users will not have access to the user site and are thus not a concern in this scenario.The subscription date is automatically set in MailChimp when the contact is created.