MenuQueries LibrarySubscribe an email on a Mailchimp listSubscribe an email on a Mailchimp listThis query subscribes an email to a Mailchimp list. query SubscribeEmailOnMailchimpList( # Email to subscribe $email: Email! # mailchimpDataCenterCode: Code for the data center of your account on Mailchimp (See: https://mailchimp.com/developer/marketing/docs/fundamentals/#api-structure) $mailchimpDataCenterCode: String! # Audience ID for the list on Mailchimp to which to subscribe the email $mailchimpAudienceID: String! ) { mailchimpUsername: _env(name: "MAILCHIMP_API_CREDENTIALS_USERNAME") @remove mailchimpPassword: _env(name: "MAILCHIMP_API_CREDENTIALS_PASSWORD") @remove mailchimpAPIEndpoint: _sprintf( string: "https://%s.api.mailchimp.com/3.0/lists/%s/members", values: [$mailchimpDataCenterCode, $mailchimpAudienceID] ) mailchimpListMembersJSONObject: _sendJSONObjectItemHTTPRequest(input: { url: $__mailchimpAPIEndpoint, method: POST, options: { auth: { username: $__mailchimpUsername, password: $__mailchimpPassword }, json: { email_address: $email, status: "subscribed" } } }) }Copy And define in wp-config.php: define( 'MAILCHIMP_API_CREDENTIALS_USERNAME', '{ username }' ); define( 'MAILCHIMP_API_CREDENTIALS_PASSWORD', '{ password }' );CopyPrevSend an email with summary of activityNextSync tags and categories for Polylang
This query subscribes an email to a Mailchimp list. query SubscribeEmailOnMailchimpList( # Email to subscribe $email: Email! # mailchimpDataCenterCode: Code for the data center of your account on Mailchimp (See: https://mailchimp.com/developer/marketing/docs/fundamentals/#api-structure) $mailchimpDataCenterCode: String! # Audience ID for the list on Mailchimp to which to subscribe the email $mailchimpAudienceID: String! ) { mailchimpUsername: _env(name: "MAILCHIMP_API_CREDENTIALS_USERNAME") @remove mailchimpPassword: _env(name: "MAILCHIMP_API_CREDENTIALS_PASSWORD") @remove mailchimpAPIEndpoint: _sprintf( string: "https://%s.api.mailchimp.com/3.0/lists/%s/members", values: [$mailchimpDataCenterCode, $mailchimpAudienceID] ) mailchimpListMembersJSONObject: _sendJSONObjectItemHTTPRequest(input: { url: $__mailchimpAPIEndpoint, method: POST, options: { auth: { username: $__mailchimpUsername, password: $__mailchimpPassword }, json: { email_address: $email, status: "subscribed" } } }) }Copy And define in wp-config.php: define( 'MAILCHIMP_API_CREDENTIALS_USERNAME', '{ username }' ); define( 'MAILCHIMP_API_CREDENTIALS_PASSWORD', '{ password }' );Copy