Class: RejectionMailer
- Inherits:
-
ActionMailer::Base
- Object
- ActionMailer::Base
- RejectionMailer
- Includes:
- Email::BuildEmailHelper
- Defined in:
- app/mailers/rejection_mailer.rb
Constant Summary collapse
- DISALLOWED_TEMPLATE_ARGS =
%i[ to from base_url user_preferences_url include_respond_instructions html_override add_unsubscribe_link respond_instructions style body post_id topic_id subject template allow_reply_by_email private_reply from_alias ]
Instance Method Summary collapse
-
#send_rejection(template, message_from, template_args) ⇒ Object
Send an email rejection message.
Methods included from Email::BuildEmailHelper
Instance Method Details
#send_rejection(template, message_from, template_args) ⇒ Object
Send an email rejection message.
template - i18n key under system_messages message_from - Who to send the rejection message to template_args - arguments to pass to i18n for interpolation into the message
Certain keys are disallowed in template_args to avoid confusing the
BuildEmailHelper. You can see the list in DISALLOWED_TEMPLATE_ARGS.
35 36 37 38 39 40 41 |
# File 'app/mailers/rejection_mailer.rb', line 35 def send_rejection(template, , template_args) if template_args.keys.any? { |k| DISALLOWED_TEMPLATE_ARGS.include? k } raise ArgumentError.new("Reserved key in template arguments") end build_email(, template_args.merge(template: "system_messages.#{template}")) end |