class NotificationMailer < ApplicationMailer before_action :set_notification # Subject can be set in your I18n file at config/locales/en.yml # with the following lookup: # # en.notification_mailer.expiration_in_60d.subject # def expiration_in_60d mail to: @notification.member.email end def expiration_in_30d mail to: @notification.member.email end def expired mail to: @notification.member.email end def expired_30d_ago mail to: @notification.member.email end def expired_60d_ago mail to: @notification.member.email end def cancelled mail to: @notification.member.email end private def set_notification @notification = params[:notification] @link = @notification.member.regular_ifthenpay_link end end