Skip to content

Instantly share code, notes, and snippets.

@SpacyRicochet
Last active December 19, 2015 12:49
Show Gist options
  • Select an option

  • Save SpacyRicochet/5958118 to your computer and use it in GitHub Desktop.

Select an option

Save SpacyRicochet/5958118 to your computer and use it in GitHub Desktop.
Mailing list subscription
_chimpKit = [[ChimpKit alloc] initWithDelegate:self andApiKey:@"APIKEY"];
NSDictionary *mergeVars = @{
@"FNAME" : @"Code name",
@"EMAIL" : @"[email protected]",
@"BIRTHDAY" : @"dd-MM-yyyy",
@"GENDER" : @"male", // or 'female'
@"LANGUAGE" : NSLocalizedString(@"Key", nil), // localized string
@"MC_LANGUAGE" : NSLocalizedString(@"HFXMailchimpLanguageString", nil), // localized string
@"SUBSCRIBE" : @"yes", // or 'no'
};
NSDictionary *params = @{
@"id" : @"MAILINGLISTID",
@"update_existing" : @"true",
@"email_address" : [mergeVars valueForKey:@"EMAIL"],
@"double_optin" : @"false",
@"send_welcome" : @"true",
@"merge_vars" : mergeVars,
};
[_chimpKit callApiMethod:@"listSubscribe" withParams:params];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment