예제 #1
0
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)
예제 #2
0
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)
예제 #3
0
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)
예제 #4
0
def event_post_save(sender, instance, created, **kwargs):
    send_metric.delay('events', customer_id=instance.customer.id)