discourse/app/mailers/invite_mailer.rb
Robin Ward e29f4a3496 Work in Progress: Reply By Email:
- Add support classes and settings to enable reply by email
- Split out Email builder to be more OO, add many specs
2013-06-13 12:39:56 -04:00

18 lines
592 B
Ruby

require_dependency 'email/message_builder'
class InviteMailer < ActionMailer::Base
include Email::BuildEmailHelper
def send_invite(invite)
# Find the first topic they were invited to
first_topic = invite.topics.order(:created_at).first
# If they were invited to a topic
build_email(invite.email,
template: 'invite_mailer',
invitee_name: invite.invited_by.username,
invite_link: "#{Discourse.base_url}/invites/#{invite.invite_key}",
topic_title: first_topic.try(:title))
end
end