ModulesΒ§
- batch_
client π - mailchimp_
ops π - policy_
tags π
StructsΒ§
- Email
Sync πResult - Field
Schema π - Mailchimp
Field π - Sync
User π - Syncer
Config π - Structure to hold the configuration settings, such as the database URL.
ConstantsΒ§
- BATCH_
POLL_ πINTERVAL_ SECS - BATCH_
POLL_ πTIMEOUT_ SECS - 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_
completed_ πtag_ for_ members - Sets or removes the β{slug}-completedβ tag on Mailchimp members based on course completion. Skips users without user_mailchimp_id.
- 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.