MailChimp is a cloud-based Email System. This services provides an /sync
endpoint which when POSTed to instructs the service to transfer new records from Janrain to a MailChimp List via HTTP calls. The intent is to have a time based service, such as a CRON job, trigger the export by POSTing to the /sync
endpoint. The service is designed to be deployed in an AWS Elastic Beanstalk Application and is configured via environment variables.
If problems arise during the process of pushing data into MailChimp you can look at the log file for visibility, open a Github Issue or contact Janrain Support (https://support.janrain.com).
Run ./bin/mailchimp-info
to get a list of Mailchimp Lists, Merge Fields, Interest Categories and Interests.
./bin/mailchimp-info
usage: mailchimp-info [-h] --key KEY
mailchimp-info: error: the following arguments are required: --key
-
FIELD_MAPPING
: A JSON string which maps janrain attribute to MailChimp List Fields. (defaul:{'familyName': "LNAME", "givenName": "FNAME", 'birthday': 'BIRTHDAY'}
) -
INTERESTS_OPT_IN_ATTRIBUTES_MAPPING
: A JSON string which maps MailChimp Interests IDs to Janrain Attributes. (example:{"6585d151f0": "optIn.morning", "faec5e7471": "optIn.evening"}
, defaul:{}
)
-
AWS_ACCESS_KEY_ID
: AWS Access Key ID -
AWS_SECRET_ACCESS_KEY
: AWS Secret Access Key
-
JANRAIN_URI
: Hostname to use when making API calls to Capture. -
JANRAIN_CLIENT_ID
: Janrain client Id. -
JANRAIN_CLIENT_SECRET
: Secret for the client. -
JANRAIN_SCHEMA_NAME
: Name of the Capture schema containing the user records. (default:user
) -
JANRAIN_OPT_IN_ATTRIBUTE
: The Attribute to use to opt-in each user.
-
MC_API_KEY
: MailChimp API Key -
MC_LIST_ID
: The id of the list. This is not the name.
-
DEBUG
: If this is set to anything other than empty string or the wordFALSE
, then the app will run in debug mode. Additional info will be written to the log. -
LOGGER_NAME
: Name of the logger.
-
APP_LOG_FILE
: Full path to the file where the app will write the log. (should only be used during local development, leave blank when deployed to elastic beanstalk) -
APP_LOG_FILESIZE
: Maximum size in bytes of the app log before it gets rotated. (default:10000000
) -
APP_LOG_NUM_BACKUPS
: Number of rotated backups of the app log that will be kept. (default:20
)
-
AWS_DEFAULT_REGION
: AWS region the app runs in. -
AWS_DYNAMODB_URL
: Url of the DynamoDB service to use. (should only be used during local development, leave blank when deployed to elastic beanstalk. Requires having .aws/credentials file for local DynamoDB development) -
AWS_DYNAMODB_TABLE
: Name of the table in DynamoDB to use. (default:janrain-mailchimp
)
-
JANRAIN_BATCH_SIZE
: The size of batch for each Janrain Capture Call. (default:100
) -
JANRAIN_MAX_LASTUPDATED
: Number of Days the lastUpdated cannot exceed. (default:1
) -
JANRAIN_FULL_EXPORT
: IfTrue
ignoreJANRAIN_MAX_LASTUPDATED
and export everything. (default:False
)
-
MC_URI_TEMPLATE
: Template used to create MailChimp API URI. -
MC_TIME_BETWEEN_BATCHES
: The time in seconds to wait before checking if the MailChimp batch is complete. (default5
) -
MC_MAX_RECORDS_IN_BATCH
: The max number of records allowed in MailChimp the batch. (default20000
) -
MC_MAX_BYTES_IN_BATCH
: The max number of bytes allowed in the MailChimp batch. (default4000000
)
- Edit
bin/environment
to include your values - Start application
./bin/run
- Run test suite
./bin/test