Class: Decidim::Conferences::Admin::SendConferenceDiplomaMailer

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

Overview

A custom mailer for sending the diploma of the conference to a registered user who attends to the conference.

Instance Method Summary collapse

Methods included from SanitizeHelper

#decidim_html_escape, #decidim_sanitize, #decidim_sanitize_newsletter, #decidim_url_escape, included

Methods included from TranslationsHelper

empty_translatable, ensure_translatable, multi_translation, translated_in_current_locale?

Methods included from TranslatableAttributes

#default_locale?

Instance Method Details

#diploma(conference, user) ⇒ Object

Send an email to an user with the diploma of conference attendance attached.

user - The user being invited conference - The conference being joined.


19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'decidim-conferences/app/mailers/decidim/conferences/admin/send_conference_diploma_mailer.rb', line 19

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

    add_diploma_attachment

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