I am using python social auth for login. After user is created I want to send the user a email. For this I am writing a custom pipeline
def send_confirmation_email(strategy, details, response, user=None, *args, **kwargs):
if user:
if kwargs['is_new']:
template = "email/social_registration_confirm.html"
subject = "Account Confirmation"
email = user.email
print(user.username)
username = user.username
kwargs.update(subject=subject, email=email, username=username)
notification_email.delay(template, **kwargs)
I am using celery
to send email. When I send email it gives me error saying <UserSocialAuth: some_username> is not JSON serializable
Why I am getting this error. notification_email
works for other email sending functionality.
Need suggestion. Thank you