Notify with anonymised email on new volunteer #48

Merged
ignisf merged 1 commits from notify-on-volunteer into master 2024-06-01 12:32:42 +03:00
3 changed files with 10 additions and 15 deletions
Showing only changes of commit 5a0efc7581 - Show all commits

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 -%>