2019-07-30 21:29:24 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-03-25 16:15:39 +00:00
|
|
|
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
2018-03-25 17:30:42 +00:00
|
|
|
class NonprofitAdminMailer < BaseMailer
|
2019-07-30 21:29:24 +00:00
|
|
|
def new_invite(role, raw_token)
|
|
|
|
@user = role.user
|
|
|
|
@title_with_article = Format::Indefinitize.with_article(role.name.to_s.titleize)
|
|
|
|
@nonprofit = role.host
|
|
|
|
@token = raw_token
|
|
|
|
mail(to: @user.email, subject: "You're now #{@title_with_article} of #{@nonprofit.name} on #{Settings.general.name}. Let's set your password.")
|
|
|
|
end
|
2018-03-25 17:30:42 +00:00
|
|
|
|
2019-07-30 21:29:24 +00:00
|
|
|
def existing_invite(role)
|
|
|
|
@user = role.user
|
|
|
|
@title_with_article = Format::Indefinitize.with_article(role.name.to_s.titleize)
|
|
|
|
@nonprofit = role.host
|
|
|
|
mail(to: @user.email, subject: "You're now #{@title_with_article} of #{@nonprofit.name} on #{Settings.general.name}.")
|
|
|
|
end
|
2018-03-25 17:30:42 +00:00
|
|
|
|
2019-07-30 21:29:24 +00:00
|
|
|
def supporter_fundraiser(event_or_campaign)
|
|
|
|
@fundraiser = event_or_campaign
|
|
|
|
@kind = event_or_campaign.class.name.downcase || 'event'
|
|
|
|
@nonprofit = event_or_campaign.nonprofit
|
|
|
|
@profile = event_or_campaign.profile
|
|
|
|
recipients = @nonprofit.nonprofit_personnel_emails
|
|
|
|
mail(to: recipients, subject: "A Supporter has created #{Format::Indefinitize.with_article(@kind.capitalize)} for your Nonprofit!")
|
|
|
|
end
|
2018-03-25 17:30:42 +00:00
|
|
|
end
|