Class: UserMailer
Instance Method Summary
collapse
environment_variables_set?, mailer_environment_variables
Instance Method Details
#no_submissions_reminder(user) ⇒ Object
15
16
17
18
19
|
# File 'app/mailers/user_mailer.rb', line 15
def no_submissions_reminder(user)
with_locale(user) do
build_email t(:start_using_mumuki), 'no_submissions_reminder'
end
end
|
#we_miss_you_reminder(user, cycles) ⇒ Object
9
10
11
12
13
|
# File 'app/mailers/user_mailer.rb', line 9
def we_miss_you_reminder(user, cycles)
with_locale(user) do
build_email t(:we_miss_you), "#{cycles.ordinalize}_reminder"
end
end
|
#welcome_email(user, organization) ⇒ Object
2
3
4
5
6
7
|
# File 'app/mailers/user_mailer.rb', line 2
def welcome_email(user, organization)
with_locale(user, organization) do
organization_name = organization.display_name || t(:your_new_organization)
build_email t(:welcome, name: organization_name), { inline: organization.welcome_email_template }, from: organization.welcome_email_sender
end
end
|
#with_locale(user, organization = nil, &block) ⇒ Object
21
22
23
24
25
26
27
|
# File 'app/mailers/user_mailer.rb', line 21
def with_locale(user, organization = nil, &block)
@user = user
@unsubscribe_code = User.unsubscription_verifier.generate(user.id)
@organization = organization || user.last_organization
I18n.with_locale(@organization.locale, &block)
end
|