kaps_app/app/mailers/general_mailer.rb
Nicolas Bally 602f61fde7 Suite
2020-02-02 22:24:38 +01:00

40 lines
848 B
Ruby
Executable File

class GeneralMailer < ActionMailer::Base
default from: "hey@kaps.net"
add_template_helper(MailHelper)
# Subject can be set in your I18n file at config/locales/en.yml
# with the following lookup:
#
# en.question.deliver.subject
#
def send_qi_mail(lang_slug, slug, to, options={})
@mail_content = MailContent.find_key(LangSite.find_by_slug(lang_slug), slug)
@lang_slug = lang_slug
@options = options
if @options[:subject]
subject = @options[:subject]
else
subject = @mail_content.subject.to_s
end
mail to: to, :subject => "[KapsMe] "+subject
end
def new_send_qi_mail(options = {})
mail to: options[:to], :subject => "[KapsMe] "+options[:subject] do |format|
format.html { render :inline => options[:body] }
end
end
end