Notify with anonymised email on new volunteer

This commit is contained in:
Tocho Tochev 2024-05-18 23:10:12 +03:00
parent 2180b0ea9f
commit 5a0efc7581
3 changed files with 10 additions and 15 deletions

View File

@ -4,7 +4,7 @@ class VolunteerMailer < ActionMailer::Base
mail(
to: @volunteer.conference.email,
subject: "Нов доброволец за #{@volunteer.conference.title}"
subject: "Нов доброволец за #{@volunteer.conference.title} - #{@volunteer.volunteer_team.name}"
)
end

View File

@ -24,6 +24,7 @@ class Volunteer < ActiveRecord::Base
before_create :assign_unique_id
before_create :assign_confirmation_token
after_commit :send_email_confirmation_to_volunteer, on: [:create]
after_commit :send_email_to_organisers, on: [:create] # technically the email is not confirmed yet
def send_notification_to_volunteer
VolunteerMailer.volunteer_notification(self).deliver_later
@ -47,6 +48,10 @@ class Volunteer < ActiveRecord::Base
VolunteerMailer.volunteer_email_confirmation(self).deliver_later
end
def send_email_to_organisers
VolunteerMailer.team_notification(self).deliver_later
end
def volunteer_teams_belong_to_conference
conference_volunteer_teams = conference.volunteer_teams
unless additional_volunteer_teams.all? { |team| conference_volunteer_teams.include? team }

View File

@ -1,21 +1,11 @@
Здравейте,
<%= @volunteer.name %> <<%= @volunteer.email %>> изпрати кандидатура за доброволец.
Някой изпрати кандидатура за доброволец.
Екипи: <%= @volunteer.volunteer_teams.map(&:name).join(', ') %>
Екип: <%= @volunteer.volunteer_team.name %>
Връзка към профил: <%= management_conference_volunteer_url(@volunteer.conference, @volunteer) %>
Език: <%= @volunteer.language %>
Телефон: <%= @volunteer.phone %>
Размер на тениска: <%= @volunteer.tshirt_size %>
Кройка на тениска: <%= @volunteer.tshirt_cut %>
Предпочитания за храна: <%= @volunteer.food_preferences %>
<% if @volunteer.previous_experience.present? -%>
Предходен опит:
<%= @volunteer.previous_experience %>
<% end -%>
<% if @volunteer.notes.present? -%>
Бележки:
<%= @volunteer.notes %>
<% end -%>