Sha256: 9906d9648c7d89c3cafc2698f3e9b880b904fd48b16ec68183f378c7b46c9219

Contents?: true

Size: 1.26 KB

Versions: 14

Compression:

Stored size: 1.26 KB

Contents

# frozen_string_literal: true

module Decidim
  module Meetings
    module Admin
      # A custom mailer for sending an invitation to join a meeting to
      # an existing user.
      class InviteJoinMeetingMailer < Decidim::ApplicationMailer
        include Decidim::TranslationsHelper
        include Decidim::SanitizeHelper

        helper Decidim::ResourceHelper
        helper Decidim::TranslationsHelper

        helper_method :routes

        # Send an email to an user to invite them to join a meeting.
        #
        # user - The user being invited
        # meeting - The meeting being joined.
        # invited_by - The user performing the invitation.
        def invite(user, meeting, invited_by)
          with_user(user) do
            @user = user
            @meeting = meeting
            @invited_by = invited_by
            @organization = @meeting.organization
            @locator = Decidim::ResourceLocatorPresenter.new(@meeting)

            subject = I18n.t("invite.subject", scope: "decidim.meetings.mailer.invite_join_meeting_mailer")
            mail(to: user.email, subject: subject)
          end
        end

        private

        def routes
          @routes ||= Decidim::EngineRouter.main_proxy(@meeting.component)
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
decidim-meetings-0.14.4 app/mailers/decidim/meetings/admin/invite_join_meeting_mailer.rb
decidim-meetings-0.14.3 app/mailers/decidim/meetings/admin/invite_join_meeting_mailer.rb
decidim-meetings-0.14.2 app/mailers/decidim/meetings/admin/invite_join_meeting_mailer.rb
decidim-meetings-0.14.1 app/mailers/decidim/meetings/admin/invite_join_meeting_mailer.rb
decidim-meetings-0.13.1 app/mailers/decidim/meetings/admin/invite_join_meeting_mailer.rb
decidim-meetings-0.12.2 app/mailers/decidim/meetings/admin/invite_join_meeting_mailer.rb
decidim-meetings-0.13.0 app/mailers/decidim/meetings/admin/invite_join_meeting_mailer.rb
decidim-meetings-0.12.1 app/mailers/decidim/meetings/admin/invite_join_meeting_mailer.rb
decidim-meetings-0.13.0.pre1 app/mailers/decidim/meetings/admin/invite_join_meeting_mailer.rb
decidim-meetings-0.12.0 app/mailers/decidim/meetings/admin/invite_join_meeting_mailer.rb
decidim-meetings-0.11.2 app/mailers/decidim/meetings/admin/invite_join_meeting_mailer.rb
decidim-meetings-0.12.0.pre app/mailers/decidim/meetings/admin/invite_join_meeting_mailer.rb
decidim-meetings-0.11.1 app/mailers/decidim/meetings/admin/invite_join_meeting_mailer.rb
decidim-meetings-0.11.0.pre1 app/mailers/decidim/meetings/admin/invite_join_meeting_mailer.rb