diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index 7a97d978a..9b27811e6 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -36,6 +36,20 @@ class UserMailer < ActionMailer::Base end end + def build_list_notification(build_list, user) + I18n.locale = user.language if user.language + @user = user + @build_list = build_list + + subject = "[#{build_list.bs_id.present? ? build_list.bs_id : t("layout.build_lists.bs_id_not_set")}] " + subject << "«#{build_list.project ? build_list.project.name_with_owner : t("layout.projects.unexisted_project")}», " + subject << user.name + subject << " - #{build_list.human_status}" + mail(:to => user.email, :subject =>subject) do |format| + format.html + end + end + def invite_approve_notification(register_request) I18n.locale = register_request.language if register_request.language @register_request = register_request diff --git a/app/views/user_mailer/build_list_notification.en.haml b/app/views/user_mailer/build_list_notification.en.haml new file mode 100644 index 000000000..3759c9cf6 --- /dev/null +++ b/app/views/user_mailer/build_list_notification.en.haml @@ -0,0 +1,16 @@ +%p + Build task + - if @build_list.project + = link_to "«#{@build_list.project.name_with_owner}»", @build_list.project + - else + = "«#{t("layout.projects.unexisted_project")}»" + , + = @user.name + finished with status + = "«#{@build_list.human_status}»." + +%p + More detailed information You can get by link: + = link_to "task [№ #{(@build_list.bs_id ? @build_list.bs_id : t("layout.build_lists.bs_id_not_set"))}]", @build_list + +%p== Support team «ROSA Build System» diff --git a/app/views/user_mailer/build_list_notification.ru.haml b/app/views/user_mailer/build_list_notification.ru.haml new file mode 100644 index 000000000..89320094d --- /dev/null +++ b/app/views/user_mailer/build_list_notification.ru.haml @@ -0,0 +1,16 @@ +%p + Сборка проекта + - if @build_list.project + = link_to "«#{@build_list.project.name_with_owner}»", @build_list.project + - else + = "«#{t("layout.projects.unexisted_project")}»" + , + = @user.name + завершена со статусом + = "«#{@build_list.human_status}»." + +%p + Более подробную информацию можно получить по ссылке: + = link_to "задание [№ #{(@build_list.bs_id ? @build_list.bs_id : t("layout.build_lists.bs_id_not_set"))}]", @build_list + +%p== Команда поддержки «ROSA Build System» diff --git a/config/locales/models/activity_feed.ru.yml b/config/locales/models/activity_feed.ru.yml index 66466da28..2eeebe2e2 100644 --- a/config/locales/models/activity_feed.ru.yml +++ b/config/locales/models/activity_feed.ru.yml @@ -18,7 +18,6 @@ ru: new_user_notification: Регистрация на проекте «%{ project_name }» issue_assign_notification: Вам назначили задачу invite_approve_notification: Приглашение в ABF - build_task: Сборочное задание bodies: new_comment_notification: