How to use the coderedcms.api.mailchimp.MailchimpApi function in coderedcms

To help you get started, we’ve selected a few coderedcms examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github coderedcorp / coderedcms / coderedcms / models / integration_models.py View on Github external
def integration_operation(self, instance, **kwargs):
        mailchimp = MailchimpApi()
        if mailchimp.is_active:
            rendered_dictionary = self.render_dictionary(
                self.format_form_submission(kwargs['form_submission']))
            mailchimp.add_user_to_list(list_id=self.get_list_id(), data=rendered_dictionary)
github coderedcorp / coderedcms / coderedcms / models / integration_models.py View on Github external
def build_list_library(self):
        mailchimp = MailchimpApi()
        list_library = {}
        if mailchimp.is_active:
            lists = mailchimp.get_lists()
            for l in lists['lists']:
                list_library[l['id']] = {
                    'name': l['name'],
                    'merge_fields': {},
                    'interest_categories': {}
                }

                list_library[l['id']]['merge_fields'] = mailchimp.get_merge_fields_for_list(l['id'])['merge_fields']  # noqa
                list_library[l['id']]['interest_categories'] = mailchimp.get_interest_categories_for_list(l['id'])['categories']  # noqa

                for category in list_library[l['id']]['interest_categories']:
                    category['interests'] = mailchimp.get_interests_for_interest_category(
                        l['id'],