Sha256: 1dc1293023e10e248044ff56cc1a65b4e1bd606aa71627bc18bdc1edb844d0ab
Contents?: true
Size: 974 Bytes
Versions: 8
Compression:
Stored size: 974 Bytes
Contents
# frozen_string_literal: true module Decidim module Votings # This mailer sends the access code via email. class AccessCodeMailer < Decidim::ApplicationMailer include TranslatableAttributes # Public: Sends an email with the access code. # # datum - The datum with the access code # locale - The locale that will be used for the email content (optional). # # Returns nothing. def send_access_code(datum, locale = nil) @datum = datum @organization = datum.dataset.voting.organization @voting = translated_attribute(datum.dataset.voting.title) I18n.with_locale(locale || @organization.default_locale) do @access_code = datum.access_code subject = I18n.t( "send_access_code.subject", scope: "decidim.events.votings", voting: @voting ) mail(to: datum.email, subject:) end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems