Sha256: fdce5067f14175b795b863b488f7622fab351239244512e0403e0a606ca7c3c9

Contents?: true

Size: 937 Bytes

Versions: 1

Compression:

Stored size: 937 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module ReportingProposals
    module Admin
      # A custom mailer to mail Decidim users
      # that they have been hidden
      class HiddenResourceMailer < Decidim::ApplicationMailer
        include Decidim::TranslationsHelper
        include Decidim::SanitizeHelper
        include Decidim::ApplicationHelper
        include Decidim::TranslatableAttributes

        helper Decidim::ResourceHelper
        helper Decidim::TranslationsHelper
        helper Decidim::ApplicationHelper

        def notify_mail(resource, resource_authors, reason)
          @resource_authors = resource_authors
          @organization = resource.organization
          @resource = resource
          @reason = reason

          mail(to: resource_authors.pluck(:email).uniq,
               subject: I18n.t("decidim.admin.hidden_resource_mailer.notify_mail.subject"))
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
decidim-reporting_proposals-0.6.0 app/mailers/concerns/decidim/reporting_proposals/admin/hidden_resource_mailer.rb