diff --git a/apiserver/plane/bgtasks/importer_task.py b/apiserver/plane/bgtasks/importer_task.py index b27787635..291b71be3 100644 --- a/apiserver/plane/bgtasks/importer_task.py +++ b/apiserver/plane/bgtasks/importer_task.py @@ -59,7 +59,9 @@ def service_importer(service, importer_id): [ send_welcome_email.delay( - user, True, f"{user.email} was imported to Plane from {service}" + str(user.id), + True, + f"{user.email} was imported to Plane from {service}", ) for user in new_users ] diff --git a/apiserver/plane/bgtasks/user_welcome_task.py b/apiserver/plane/bgtasks/user_welcome_task.py index cad2aed1a..c042d0a0b 100644 --- a/apiserver/plane/bgtasks/user_welcome_task.py +++ b/apiserver/plane/bgtasks/user_welcome_task.py @@ -10,9 +10,15 @@ from sentry_sdk import capture_exception from slack_sdk import WebClient from slack_sdk.errors import SlackApiError +# Module imports +from plane.db.models import User + + @shared_task -def send_welcome_email(instance, created, message): +def send_welcome_email(user_id, created, message): try: + instance = User.objects.get(pk=user_id) + if created and not instance.is_bot: first_name = instance.first_name.capitalize() to_email = instance.email