Last active
February 21, 2018 18:18
-
-
Save jordotech/1ac2a38606e511364a1fb4cbf631cdb3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db.models.signals import post_save | |
import mailchimp3 | |
@receiver(post_save, sender=Cart) | |
def send_cart_data_to_mailchimp(sender, instance, raw, created, using, **kwargs): | |
# https://developer.mailchimp.com/documentation/mailchimp/reference/ecommerce/stores/carts/ | |
if not created: | |
return | |
data = { | |
'id':instance.id, | |
'customer':{ | |
'id':'dunno yet', | |
} | |
} | |
client = mailchimp3.MailChimp('stuff') | |
# todo: send data to MC | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment