Structsยง
- Field
Schema ๐ - Mailchimp
Field ๐ - Syncer
Config ๐ - Structure to hold the configuration settings, such as the database URL.
Constantsยง
- BATCH_
SIZE ๐ - FIELDS_
EXCLUDED_ ๐FROM_ REMOVING - These fields are excluded from removing all fields that are not in the schema
- PRINT_
STILL_ ๐RUNNING_ MESSAGE_ TICKS_ THRESHOLD - PROCESS_
UNSUBSCRIBES_ ๐INTERVAL_ SECS - REMOVE_
UNSUPPORTED_ ๐FIELDS - REQUIRED_
FIELDS ๐ - SYNC_
INTERVAL_ ๐SECS
Functionsยง
- add_
field_ ๐to_ mailchimp - Adds a new merge field to the Mailchimp list.
- ensure_
mailchimp_ ๐schema - Ensures the Mailchimp schema is up to date, adding required fields and removing any extra ones.
- fetch_
current_ ๐mailchimp_ fields - Fetches the current merge fields from the Mailchimp list schema.
- fetch_
unsubscribed_ ๐users_ from_ mailchimp_ in_ chunks - Fetches data from Mailchimp in chunks.
- initialize_
configuration ๐ - Initializes and returns configuration settings (database URL).
- initialize_
database_ ๐pool - Initializes the PostgreSQL connection pool from the provided database URL.
- initialize_
environment ๐ - Initializes environment variables, logging, and tracing setup.
- main
- The main function that initializes environment variables, config, and sync process.
- process_
unsubscribed_ ๐users_ from_ mailchimp - remove_
field_ ๐from_ mailchimp - Removes a merge field from the Mailchimp list by with a field ID.
- send_
users_ to_ mailchimp - Sends a batch of users to Mailchimp for synchronization.
- sync_
contacts ๐ - Synchronizes the user contacts with Mailchimp. Added a boolean flag to determine whether to process unsubscribes.
- sync_
tags_ from_ mailchimp - Fetch tags from mailchimp and sync the changes to the database
- update_
emails_ ๐in_ mailchimp - Updates the email addresses of multiple users in a Mailchimp mailing list.