mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 02:48:28 +08:00
FIX: Correctly use invite to topic email templates (#12411)
It was used both when inviting from a topic page and when creating invites with "Send to topic on first login", while it should be used only in the former case.
This commit is contained in:
@ -5,7 +5,7 @@ class InviteMailer < ActionMailer::Base
|
||||
|
||||
layout 'email_template'
|
||||
|
||||
def send_invite(invite)
|
||||
def send_invite(invite, invite_to_topic: false)
|
||||
# Find the first topic they were invited to
|
||||
first_topic = invite.topics.order(:created_at).first
|
||||
|
||||
@ -19,7 +19,7 @@ class InviteMailer < ActionMailer::Base
|
||||
ActionView::Base.full_sanitizer.sanitize(invite.custom_message.gsub(/\n+/, " ").strip) : nil
|
||||
|
||||
# If they were invited to a topic
|
||||
if first_topic.present?
|
||||
if invite_to_topic && first_topic.present?
|
||||
# get topic excerpt
|
||||
topic_excerpt = ""
|
||||
if first_topic.excerpt
|
||||
|
Reference in New Issue
Block a user