scinote-web/app/mailers/app_mailer.rb
Luka Murn 02d3e03f75 Bugfix for notification emails
The URLs in notification emails didn't get server URL prepended,
so users could not click on them.
2016-10-13 12:12:28 +02:00

17 lines
453 B
Ruby

class AppMailer < Devise::Mailer
helper :application, :mailer
include Devise::Controllers::UrlHelpers
default template_path: 'users/mailer'
default from: ENV["MAIL_FROM"]
default reply: ENV["MAIL_REPLYTO"]
def notification(user, notification, opts = {})
@user = user
@notification = notification
headers = {
to: @user.email,
subject: I18n.t('notifications.email_title')
}.merge(opts)
mail(headers)
end
end