Skip to content

Commit 284bf39

Browse files
committed
make send welcome email
1 parent 936a4e1 commit 284bf39

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

framework/auth/views.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,12 +733,23 @@ def confirm_email_get(token, auth=None, **kwargs):
733733
})
734734

735735
if is_initial_confirmation:
736+
notification_type = NotificationType.Type.USER_WELCOME
737+
notification_type.instance.emit(
738+
user=user,
739+
subscribed_object=user,
740+
event_context={
741+
'user_fullname': user.fullname,
742+
'storage_flag_is_active': getattr(user, 'storage_flag_is_active', False),
743+
'domain': settings.DOMAIN,
744+
},
745+
)
736746
user.update_date_last_login()
737747
user.save()
738748

739749
# new random verification key, allows CAS to authenticate the user w/o password one-time only.
740750
user.verification_key = generate_verification_key()
741751
user.save()
752+
742753
# redirect to CAS and authenticate the user with a verification key.
743754
return redirect(cas.get_login_url(
744755
request.url,

osf/models/notification_type.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class Type(str, Enum):
4848
USER_REGISTRATION_BULK_UPLOAD_SUCCESS_PARTIAL = 'user_registration_bulk_upload_success_partial'
4949
USER_REGISTRATION_BULK_UPLOAD_SUCCESS_ALL = 'user_registration_bulk_upload_success_all'
5050
USER_ADD_SSO_EMAIL_OSF4I = 'user_add_sso_email_osf4i'
51+
USER_WELCOME = 'user_welcome'
5152
USER_WELCOME_OSF4I = 'user_welcome_osf4i'
5253
USER_ARCHIVE_JOB_EXCEEDED = 'user_archive_job_exceeded'
5354
USER_ARCHIVE_JOB_COPY_ERROR = 'user_archive_job_copy_error'

0 commit comments

Comments
 (0)