Sha256: a6c95b1275bb1ff92ae3d9f7477dcf03e6fd039943f0735e3513192e3fa9eb45

Contents?: true

Size: 1.02 KB

Versions: 45

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true

module Decidim
  module Budgets
    class OrderSummaryMailer < Decidim::ApplicationMailer
      include Decidim::TranslationsHelper
      include Decidim::SanitizeHelper

      helper Decidim::TranslationsHelper

      # Send an email to an user with the summary of the order.
      #
      # order - the order that was just created
      def order_summary(order)
        user = order.user

        with_user(user) do
          @user = user
          @order = order
          @budget = order.budget
          @space = order.budget.participatory_space
          @component = order.budget.component
          @organization = order.budget.participatory_space.organization

          subject = I18n.t(
            "order_summary.subject",
            scope: "decidim.budgets.order_summary_mailer",
            budget_name: translated_attribute(@budget.title),
            space_name: translated_attribute(@space.title)
          )
          mail(to: user.email, subject: subject)
        end
      end
    end
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
decidim-budgets-0.27.9 app/mailers/decidim/budgets/order_summary_mailer.rb
decidim-budgets-0.27.8 app/mailers/decidim/budgets/order_summary_mailer.rb
decidim-budgets-0.27.7 app/mailers/decidim/budgets/order_summary_mailer.rb
decidim-budgets-0.27.6 app/mailers/decidim/budgets/order_summary_mailer.rb
decidim-budgets-0.26.10 app/mailers/decidim/budgets/order_summary_mailer.rb
decidim-budgets-0.26.9 app/mailers/decidim/budgets/order_summary_mailer.rb
decidim-budgets-0.27.5 app/mailers/decidim/budgets/order_summary_mailer.rb
decidim-budgets-0.26.8 app/mailers/decidim/budgets/order_summary_mailer.rb
decidim-budgets-0.27.4 app/mailers/decidim/budgets/order_summary_mailer.rb
decidim-budgets-0.27.3 app/mailers/decidim/budgets/order_summary_mailer.rb
decidim-budgets-0.26.7 app/mailers/decidim/budgets/order_summary_mailer.rb
decidim-budgets-0.26.5 app/mailers/decidim/budgets/order_summary_mailer.rb
decidim-budgets-0.27.2 app/mailers/decidim/budgets/order_summary_mailer.rb
decidim-budgets-0.27.1 app/mailers/decidim/budgets/order_summary_mailer.rb
decidim-budgets-0.26.4 app/mailers/decidim/budgets/order_summary_mailer.rb
decidim-budgets-0.27.0 app/mailers/decidim/budgets/order_summary_mailer.rb
decidim-budgets-0.26.3 app/mailers/decidim/budgets/order_summary_mailer.rb
decidim-budgets-0.27.0.rc2 app/mailers/decidim/budgets/order_summary_mailer.rb
decidim-budgets-0.27.0.rc1 app/mailers/decidim/budgets/order_summary_mailer.rb
decidim-budgets-0.26.2 app/mailers/decidim/budgets/order_summary_mailer.rb