mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: send set password instructions after invite redemption
This commit is contained in:
@@ -48,6 +48,7 @@ InviteRedeemer = Struct.new(:invite, :username, :name) do
|
||||
send_welcome_message
|
||||
approve_account_if_needed
|
||||
notify_invitee
|
||||
send_password_instructions
|
||||
end
|
||||
|
||||
def invite_was_redeemed?
|
||||
@@ -102,6 +103,12 @@ InviteRedeemer = Struct.new(:invite, :username, :name) do
|
||||
invited_user.approve(invite.invited_by_id, false)
|
||||
end
|
||||
|
||||
def send_password_instructions
|
||||
if !SiteSetting.enable_sso && SiteSetting.enable_local_logins && !invited_user.has_password?
|
||||
Jobs.enqueue(:invite_password_instructions_email, username: invited_user.username)
|
||||
end
|
||||
end
|
||||
|
||||
def notify_invitee
|
||||
invite.invited_by.notifications.create(notification_type: Notification.types[:invitee_accepted],
|
||||
data: {display_username: invited_user.username}.to_json)
|
||||
|
||||
Reference in New Issue
Block a user