A customer from the media publishing industry needed an automated transfer of contacts from various Mailchimp lists into their internal FileMaker database. Contacts were being added to Mailchimp from multiple sources — web forms, external applications, and manual entries from marketing campaigns.

We built upon an existing solution that provided automatic synchronization of contacts from Mailchimp lists to the FileMaker database. After migrating to a new server, we modified the scripts to match the new infrastructure, ensured compatibility with the latest version of PHP, and optimized them. All of this was done using the PHP library fmRESTor.
The core of our solution is a webhook script that is triggered whenever a list is updated in Mailchimp — for example, when a new subscriber is added. This ensures instant data synchronization. To prevent data loss in case the web application becomes unavailable, we implemented an additional script that regularly checks for changes over a defined period and syncs them retroactively. This mechanism serves as a fail-safe, keeping the database fully up to date.
Both scripts communicate with Mailchimp using the official Mailchimp API, retrieving data based on time parameters. The entire solution runs on plain PHP without a framework, which allows for easy maintenance and adaptation for other projects.