def customer_post_save(sender, instance, created, **kwargs): if created: stripe_get_card_fingerprint.delay(customer_id=instance.id, cus_stripe_id=instance.stripe_id) leads_segment_id = settings.MAILCHIMP_LEADS_SEGMENT mailchimp_subscribe.delay(email=instance.user.email, is_lead=False, merge_vars={ 'FNAME': instance.first_name, 'LNAME': instance.last_name }) mailchimp_segment_member_del.apply_async( (instance.user.email, leads_segment_id), countdown=20) create_intercom_profile.delay(email=instance.user.email) update_intercom_profile.apply_async((instance.id, ), countdown=3) else: update_intercom_profile.delay(customer_id=instance.id) send_metric.delay('customers', customer_id=instance.id)
def referral_voucher_post_save(sender, instance, created, **kwargs): if created: mailchimp_subscribe.delay(email=instance.recipient_email) send_metric.delay('invites', invite_id=instance.id)
def order_post_save(sender, instance, created, **kwargs): update_intercom_profile.delay(customer_id=instance.customer.id) send_metric.delay('orders', order_id=instance.id) send_metric.delay('customers', customer_id=instance.customer.id)
def event_post_save(sender, instance, created, **kwargs): send_metric.delay('events', customer_id=instance.customer.id)