diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index 3ed05b1bb0..5f7053fc03 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -111,6 +111,40 @@ class UserMailer < ActionMailer::Base end end + def copy_project_failed(user, source_project, target_project_name) + @source_project = source_project + @target_project_name = target_project_name + + open_project_headers 'Source-Project' => source_project.identifier, + 'Author' => user.login + + message_id source_project, user + + with_locale_for(user) do + subject = I18n.t('copy_project.failed', source_project_name: source_project.name) + + mail to: user.mail, subject: subject + end + end + + def copy_project_succeeded(user, source_project, target_project, errors) + @source_project = source_project + @target_project = target_project + @errors = errors + + open_project_headers 'Source-Project' => source_project.identifier, + 'Target-Project' => target_project.identifier, + 'Author' => user.login + + message_id target_project, user + + with_locale_for(user) do + subject = I18n.t('copy_project.succeeded', target_project_name: target_project.name) + + mail to: user.mail, subject: subject + end + end + def news_added(user, news) @news = news diff --git a/config/locales/de.yml b/config/locales/de.yml index 73b99c5915..cdd5537a13 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -378,6 +378,10 @@ de: button_configure_menu_entry: "Menüpunkt konfigurieren" button_delete_menu_entry: "Menüpunkt entfernen" + copy_project: + failed: "Das Projekt %{source_project_name} konnte nicht kopiert werden" + succeeded: "Das Projekt %{target_project_name} wurde erstellt" + create_child_page: "Neue Unterseite anlegen" create_child_page_for: "Neue Unterseite anlegen: \"%{title}\"" create_new_page: "Neue Seite anlegen" diff --git a/config/locales/en.yml b/config/locales/en.yml index 0f9a8e35ab..6949d460a8 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -376,6 +376,10 @@ en: button_configure_menu_entry: "Configure menu item" button_delete_menu_entry: "Delete menu item" + copy_project: + failed: "Cannot copy project %{source_project_name}" + succeeded: "Created project %{target_project_name}" + create_child_page: "Create new child page" create_child_page_for: "Create new child page: \"%{title}\"" create_new_page: "Create new page"