Class: Decidim::NewsletterMailer
- Inherits:
-
ApplicationMailer
- Object
- ActionMailer::Base
- ApplicationMailer
- Decidim::NewsletterMailer
- Includes:
- NewslettersHelper
- Defined in:
- app/mailers/decidim/newsletter_mailer.rb
Instance Method Summary collapse
Methods included from NewslettersHelper
#custom_url_for_mail_root, #parse_interpolations, #utm_codes
Instance Method Details
#newsletter(user, newsletter) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/mailers/decidim/newsletter_mailer.rb', line 10 def (user, ) @organization = user.organization = @user = user @custom_url_for_mail_root = custom_url_for_mail_root(@organization, .id) if Decidim.config. @encrypted_token = Decidim::NewsletterEncryptor.sent_at_encrypted(@user.id, .sent_at) with_user(user) do @subject = parse_interpolations(.subject[I18n.locale.to_s], user, .id) @body = parse_interpolations(.body[I18n.locale.to_s], user, .id) mail(to: "#{user.name} <#{user.email}>", subject: @subject) end end |