Sha256: fa71c7b6941f231ba87b9d96a165ef0d430ed2117ab9993255d59c83afc66269
Contents?: true
Size: 646 Bytes
Versions: 36
Compression:
Stored size: 646 Bytes
Contents
# frozen_string_literal: true module Decidim class NewsletterMailer < ApplicationMailer add_template_helper Decidim::TranslationsHelper def newsletter(user, newsletter) @organization = user.organization @newsletter = newsletter with_user(user) do @subject = parse_interpolations(@newsletter.subject[I18n.locale.to_s], user) @body = parse_interpolations(@newsletter.body[I18n.locale.to_s], user) mail(to: "#{user.name} <#{user.email}>", subject: @subject) end end private def parse_interpolations(content, user) content.gsub("%{name}", user.name) end end end
Version data entries
36 entries across 36 versions & 2 rubygems