mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 19:27:52 +01:00
Hotfix: set current tenant in invitations mailer (#400)
This commit is contained in:
committed by
GitHub
parent
519ec80b90
commit
53c7ffd95f
@@ -24,9 +24,15 @@ class InvitationsController < ApplicationController
|
||||
invitation.save!
|
||||
|
||||
# replace %link% placeholder in body with the invitation link
|
||||
body_with_link = body.gsub('%link%', get_url_for(method(:new_user_registration_url), options: { invitation_token: invitation_token, email: email }))
|
||||
body_with_link = body.gsub(
|
||||
'%link%',
|
||||
get_url_for(
|
||||
method(:new_user_registration_url),
|
||||
options: { invitation_token: invitation_token, email: email }
|
||||
)
|
||||
)
|
||||
|
||||
InvitationMailer.invite(to: email, subject: subject, body: body_with_link).deliver_later
|
||||
InvitationMailer.invite(invitation: invitation, subject: subject, body: body_with_link).deliver_later
|
||||
|
||||
num_invitations_sent += 1
|
||||
end
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
class InvitationMailer < ApplicationMailer
|
||||
def invite(to:, subject:, body:)
|
||||
def invite(invitation:, subject:, body:)
|
||||
Current.tenant = invitation.tenant
|
||||
|
||||
to = invitation.email
|
||||
@body = body
|
||||
|
||||
mail(
|
||||
|
||||
Reference in New Issue
Block a user