mhuber84 / femanager-mailchimp
TYPO3 CMS Extension to connect femanager and mailchimp
Requires
- in2code/femanager: dev-eap||^8.0
- mailchimp/marketing: ^3.0
- typo3/cms-core: ^12.4
Requires (Dev)
- roave/security-advisories: dev-latest
- typo3/tailor: ^1.5
Replaces
- typo3-ter/femanager-mailchimp: 3.0.0
README
This extension adds a new field "tx_femanagermailchimp_newsletter" to the fe_users table and integrates it into the extension femanager.
It adds a finisher to the new and edit action to subscribe/unsubscribe the user from a mailchimp audience/list.
It adds a middleware which can be used as mailchimp webhook. If a user unsubscribes directly on mailchimp, the data in TYPO3 is updated.
Installation
Install with
composer require mhuber84/femanager-mailchimp
Attention: If you extend femanager's domain model user in your own theme extension, then add femanager-mailchimp as requirement in your theme's composer.json instead of your projects composer.json and as depenency in your theme's ext_emconf.php. It has to be loaded before your theme! In your user domain model extend\Mhuber84\FemanagerMailchimp\Domain\Model\User
instead of\In2code\Femanager\Domain\Model\User
and add'newsletter' => ['fieldName' => 'tx_femanagermailchimp_newsletter',],
to the properties in your Configuration/Extbase/Persistence/Classes.php.Include TypoScript Check if this overwrites your own settings and adjust if necessary! :-)
Include Page TsConfig
Add Partial
<f:render partial="Fields/Newsletter" arguments="{_all}" />
to your new and edit templates.Configure API in ExtensionManager
Configure Webhook "https://example.de/femanagermailchimp/unsubscribe?secret=dummy" in Mailchimp to get updates if a user unsubscribes. For offline testing use curl:
curl -X "POST" "https://example.ddev.site/femanagermailchimp/unsubscribe?secret=dummy" \ -H "Content-Type: application/x-www-form-urlencoded" \ --data-urlencode "type=unsubscribe" \ --data-urlencode "data[email]=test@example.de" \ --data-urlencode "data[list_id]=dummy"
Author
Marco Huber, @mhuber84@troet.cafe, mail@marco-huber.de
Feel free to contribute and send in pull requests or create an issue on https://gitlab.com/mhuber84/femanager-mailchimp