Copy project success/failure mail methods

pull/1432/head
Hagen Schink 11 years ago
parent 8681d466bb
commit 37b531f763
  1. 34
      app/mailers/user_mailer.rb
  2. 4
      config/locales/de.yml
  3. 4
      config/locales/en.yml

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

@ -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"

@ -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"

Loading…
Cancel
Save