diff --git a/app/mailers/event_mailer.rb b/app/mailers/event_mailer.rb new file mode 100644 index 0000000..6a996e5 --- /dev/null +++ b/app/mailers/event_mailer.rb @@ -0,0 +1,14 @@ +# coding: utf-8 +class EventMailer < ActionMailer::Base + def confirmation_request(event) + @event = event + I18n.locale = @event.proposer.language + + mail to: @event.proposer.email, + from: 'program@openfest.org', + subject: I18n.t('event_mailer.acceptance_notification.subject', + conference: @event.conference.title, + submission_type: @event.event_type.name.mb_chars.downcase.to_s, + title: @event.title) + end +end diff --git a/app/views/event_mailer/confirmation_request.bg.text.erb b/app/views/event_mailer/confirmation_request.bg.text.erb new file mode 100644 index 0000000..4a899eb --- /dev/null +++ b/app/views/event_mailer/confirmation_request.bg.text.erb @@ -0,0 +1,15 @@ +Здравейте, + +Радваме се да Ви съобщим, че предложението Ви за участие в <%= @event.conference.title %> с <%= @event.event_type.name.mb_chars.downcase %> на тема „<%= @event.title %>“ беше одобрено. <% if @event.slot.present? -%> +Ще се проведе на <%= I18n.l @event.slot.starts_at, format: :long %> часа. +<% else %> +Все още не са избрани час и дата за провеждането му. +<% end %> + +Моля, потвърдете участието си възможно най-скоро като кликнете на следния линк: +<%= confirm_event_url @event, host: Event.last.conference.host_name, protocol: 'https' %> + +Отговорете на този email, ако възникнат някакви въпроси. + +Поздрави, +Екипът на <%= @event.conference.title %> diff --git a/app/views/event_mailer/confirmation_request.en.text.erb b/app/views/event_mailer/confirmation_request.en.text.erb new file mode 100644 index 0000000..2cfe2ab --- /dev/null +++ b/app/views/event_mailer/confirmation_request.en.text.erb @@ -0,0 +1,15 @@ +Hello, + +We are happy to notify you that your request for participation in <%= @event.conference.title %> with the <%= @event.event_type.name.downcase %> titled "<%= @event.title %>" was approved. <% if @event.slot.present? -%> +It has been scheduled for <%= I18n.l @event.slot.starts_at, format: :long %>. +<% else %> +It has not been scheduled yet. +<% end %> + +Please confirm your participation as soon as you can by following the following link: +<%= confirm_event_url @event, host: Event.last.conference.host_name, protocol: 'https' %> + +Please respond to this email in case you have any questions. + +Regards, +The <%= @event.conference.title %> Team diff --git a/config/locales/bg.yml b/config/locales/bg.yml index b96c5f2..b93c98e 100644 --- a/config/locales/bg.yml +++ b/config/locales/bg.yml @@ -159,7 +159,7 @@ bg: improbable_phone: "не е валиден телефонен номер" event_mailer: acceptance_notification: - subject: "Предложението ви за %{conference} за %{submission_type} „%{title}“ е одобрено" + subject: "Предложението Ви за провеждане на %{submission_type} „%{title}“ на %{conference} е одобрено" event_states: approved: one: "Одобрено"