Sha256: f71e243ba5a05a243bb38eeb4e686caa9a326810d81ee1000c368aed88cf5763
Contents?: true
Size: 1.14 KB
Versions: 18
Compression:
Stored size: 1.14 KB
Contents
# encoding: utf-8 module Symphonia class Notifier < ApplicationMailer # default from: "noreply@host.cz", :host => 'host.cz' helper :application helper Symphonia::ApplicationHelper def mail(headers={}, &block) I18n.locale = Symphonia.config[:backend_locale] super end def activation_user(user) @user = user mail({ to: @user.mail, subject: t(:subject_activation_mail) }) end def user_change_to_active(user) @user = user mail({ to: @user.mail, subject: 'Váš účet je aktivován' }) end def reset_password_user(user) @user = user mail({ to: @user.mail, subject: t(:subject_reset_password_mail) }) end def user_registered(user) @user = user @recipients = Symphonia::User.recipients_for(:notify_after_user_registered).pluck(:mail).uniq mail({ to: @recipients, subject: t(:subject_user_registered) }) if @recipients.any? end def test_mail(user_id = nil) @user = Symphonia::User.find_by(id: user_id) || Symphonia::User.active.where(admin: true).first mail(to: @user.mail, subject: 'Symphonia testing mail') end end end
Version data entries
18 entries across 18 versions & 1 rubygems