You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
553 B
22 lines
553 B
from mixpanel import Mixpanel
|
|
|
|
from django.conf import settings
|
|
|
|
from project.celery import app
|
|
|
|
|
|
@app.task
|
|
def user_to_mixpanel(user_id, email, phone, first_name, last_name, date_joined, role, subscriptions):
|
|
mix = Mixpanel(settings.MIX_TOKEN)
|
|
mix.people_set(
|
|
user_id,
|
|
{
|
|
'$email': email,
|
|
'$phone': phone,
|
|
'$first_name': first_name,
|
|
'$last_name': last_name,
|
|
'$created': date_joined,
|
|
'role': role,
|
|
'subscriptions': subscriptions,
|
|
}
|
|
)
|
|
|