Skip to content

Instantly share code, notes, and snippets.

@jordotech
Last active February 21, 2018 18:18
Show Gist options
  • Save jordotech/1ac2a38606e511364a1fb4cbf631cdb3 to your computer and use it in GitHub Desktop.
Save jordotech/1ac2a38606e511364a1fb4cbf631cdb3 to your computer and use it in GitHub Desktop.
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