Module mailchimp_syncer

Source

Structsยง

FieldSchema ๐Ÿ”’
MailchimpField ๐Ÿ”’
SyncerConfig ๐Ÿ”’
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.