Class: Decidim::Conferences::ConferenceRegistrationMailer

Inherits:
ApplicationMailer
  • Object
show all
Includes:
ActionView::Helpers::SanitizeHelper, TranslationsHelper
Defined in:
decidim-conferences/app/mailers/decidim/conferences/conference_registration_mailer.rb

Overview

A custom mailer for sending notifications to users when they join a conference.

Instance Method Summary collapse

Methods included from TranslationsHelper

empty_translatable, ensure_translatable, multi_translation, translated_in_current_locale?

Methods included from TranslatableAttributes

#default_locale?

Instance Method Details

#confirmation(user, conference, registration_type) ⇒ Object


28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'decidim-conferences/app/mailers/decidim/conferences/conference_registration_mailer.rb', line 28

def confirmation(user, conference, registration_type)
  with_user(user) do
    @user = user
    @conference = conference
    @organization = @conference.organization
    @locator = Decidim::ResourceLocatorPresenter.new(@conference)
    @registration_type = registration_type

    add_calendar_attachment

    subject = I18n.t("confirmation.subject", scope: "decidim.conferences.mailer.conference_registration_mailer")
    mail(to: user.email, subject: subject)
  end
end

#pending_validation(user, conference, registration_type) ⇒ Object


15
16
17
18
19
20
21
22
23
24
25
26
# File 'decidim-conferences/app/mailers/decidim/conferences/conference_registration_mailer.rb', line 15

def pending_validation(user, conference, registration_type)
  with_user(user) do
    @user = user
    @conference = conference
    @organization = @conference.organization
    @locator = Decidim::ResourceLocatorPresenter.new(@conference)
    @registration_type = registration_type

    subject = I18n.t("pending_validation.subject", scope: "decidim.conferences.mailer.conference_registration_mailer")
    mail(to: user.email, subject: subject)
  end
end