FEATURE: Allow sending a message with invite (#12892)

* FEATURE: Allow sending a message with invite

It used to be a staff-only feature and this commit makes it available
to everyone who can invite.

* FIX: Inviting to topic uses another email template

This used to be the case, but the extra parameter was lost when we
switched to the new modal.
This commit is contained in:
Dan Ungureanu
2021-05-06 10:16:42 +03:00
committed by GitHub
parent b5a70bbb25
commit 17efce9023
4 changed files with 21 additions and 10 deletions

View File

@@ -183,7 +183,7 @@ class InvitesController < ApplicationController
if invite.emailed_status == Invite.emailed_status_types[:pending]
invite.update_column(:emailed_status, Invite.emailed_status_types[:sending])
Jobs.enqueue(:invite_email, invite_id: invite.id)
Jobs.enqueue(:invite_email, invite_id: invite.id, invite_to_topic: params[:invite_to_topic])
end
render_serialized(invite, InviteSerializer, scope: guardian, root: nil, show_emails: params.has_key?(:email))