mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: enqueue activation email for invited user that has password set
This commit is contained in:
@@ -62,6 +62,7 @@ InviteRedeemer = Struct.new(:invite, :username, :name, :password) do
|
||||
send_welcome_message
|
||||
notify_invitee
|
||||
send_password_instructions
|
||||
enqueue_activation_mail
|
||||
delete_duplicate_invites
|
||||
end
|
||||
|
||||
@@ -126,6 +127,13 @@ InviteRedeemer = Struct.new(:invite, :username, :name, :password) do
|
||||
end
|
||||
end
|
||||
|
||||
def enqueue_activation_mail
|
||||
if invited_user.has_password?
|
||||
email_token = invited_user.email_tokens.create(email: invited_user.email)
|
||||
Jobs.enqueue(:critical_user_email, type: :signup, user_id: invited_user.id, email_token: email_token.token)
|
||||
end
|
||||
end
|
||||
|
||||
def notify_invitee
|
||||
if inviter = invite.invited_by
|
||||
inviter.notifications.create(notification_type: Notification.types[:invitee_accepted],
|
||||
|
||||
Reference in New Issue
Block a user