Compare commits
1 Commits
master
...
notify-on-
Author | SHA1 | Date |
---|---|---|
Tocho Tochev | 5a0efc7581 |
|
@ -4,7 +4,7 @@ class VolunteerMailer < ActionMailer::Base
|
||||||
|
|
||||||
mail(
|
mail(
|
||||||
to: @volunteer.conference.email,
|
to: @volunteer.conference.email,
|
||||||
subject: "Нов доброволец за #{@volunteer.conference.title}"
|
subject: "Нов доброволец за #{@volunteer.conference.title} - #{@volunteer.volunteer_team.name}"
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ class Volunteer < ActiveRecord::Base
|
||||||
before_create :assign_unique_id
|
before_create :assign_unique_id
|
||||||
before_create :assign_confirmation_token
|
before_create :assign_confirmation_token
|
||||||
after_commit :send_email_confirmation_to_volunteer, on: [:create]
|
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
|
def send_notification_to_volunteer
|
||||||
VolunteerMailer.volunteer_notification(self).deliver_later
|
VolunteerMailer.volunteer_notification(self).deliver_later
|
||||||
|
@ -47,6 +48,10 @@ class Volunteer < ActiveRecord::Base
|
||||||
VolunteerMailer.volunteer_email_confirmation(self).deliver_later
|
VolunteerMailer.volunteer_email_confirmation(self).deliver_later
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def send_email_to_organisers
|
||||||
|
VolunteerMailer.team_notification(self).deliver_later
|
||||||
|
end
|
||||||
|
|
||||||
def volunteer_teams_belong_to_conference
|
def volunteer_teams_belong_to_conference
|
||||||
conference_volunteer_teams = conference.volunteer_teams
|
conference_volunteer_teams = conference.volunteer_teams
|
||||||
unless additional_volunteer_teams.all? { |team| conference_volunteer_teams.include? team }
|
unless additional_volunteer_teams.all? { |team| conference_volunteer_teams.include? team }
|
||||||
|
|
|
@ -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.language %>
|
||||||
Телефон: <%= @volunteer.phone %>
|
|
||||||
Размер на тениска: <%= @volunteer.tshirt_size %>
|
Размер на тениска: <%= @volunteer.tshirt_size %>
|
||||||
Кройка на тениска: <%= @volunteer.tshirt_cut %>
|
Кройка на тениска: <%= @volunteer.tshirt_cut %>
|
||||||
Предпочитания за храна: <%= @volunteer.food_preferences %>
|
|
||||||
<% if @volunteer.previous_experience.present? -%>
|
|
||||||
|
|
||||||
Предходен опит:
|
|
||||||
<%= @volunteer.previous_experience %>
|
|
||||||
<% end -%>
|
|
||||||
<% if @volunteer.notes.present? -%>
|
|
||||||
|
|
||||||
Бележки:
|
|
||||||
<%= @volunteer.notes %>
|
|
||||||
<% end -%>
|
|
||||||
|
|
Loading…
Reference in New Issue