Added 'email sending test' functionality.
Go to Admin -> Mail notifications and click on 'Send a test email'. If an error occurs while sending the mail, the error message is displayed to the user. git-svn-id: http://redmine.rubyforge.org/svn/trunk@632 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
7e755a53b8
commit
0061a3f04a
|
@ -56,6 +56,20 @@ class AdminController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def test_email
|
||||
raise_delivery_errors = ActionMailer::Base.raise_delivery_errors
|
||||
# Force ActionMailer to raise delivery errors so we can catch it
|
||||
ActionMailer::Base.raise_delivery_errors = true
|
||||
begin
|
||||
@test = Mailer.deliver_test(logged_in_user)
|
||||
flash[:notice] = l(:notice_email_sent, logged_in_user.mail)
|
||||
rescue Exception => e
|
||||
flash[:error] = l(:notice_email_error, e.message)
|
||||
end
|
||||
ActionMailer::Base.raise_delivery_errors = raise_delivery_errors
|
||||
redirect_to :action => 'mail_options'
|
||||
end
|
||||
|
||||
def info
|
||||
@db_adapter_name = ActiveRecord::Base.connection.adapter_name
|
||||
@flags = Hash.new
|
||||
|
|
|
@ -113,4 +113,11 @@ class Mailer < ActionMailer::Base
|
|||
@subject = "[#{message.board.project.name} - #{message.board.name}] #{message.subject}"
|
||||
@body['message'] = message
|
||||
end
|
||||
|
||||
def test(user)
|
||||
set_language_if_valid(user.language)
|
||||
@recipients = user.mail
|
||||
@from = Setting.mail_from
|
||||
@subject = 'Redmine'
|
||||
end
|
||||
end
|
||||
|
|
|
@ -16,10 +16,11 @@
|
|||
<div class="clear"></div>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
<br />
|
||||
<p><%= check_all_links('mail_options_form') %></p>
|
||||
<%= check_all_links('mail_options_form') %>
|
||||
</div>
|
||||
|
||||
<%= submit_tag l(:button_save) %>
|
||||
<p><%= submit_tag l(:button_save) %></p>
|
||||
<% end %>
|
||||
|
||||
<%= link_to l(:label_send_test_email), :action => 'test_email' %>
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
This is a test email sent by Redmine.
|
|
@ -69,6 +69,8 @@ notice_file_not_found: Несъществуваща или преместена
|
|||
notice_locking_conflict: Друг потребител променя тези данни в момента.
|
||||
notice_scm_error: Несъществуващ обект в склада.
|
||||
notice_not_authorized: Нямате право на достъп до тази страница.
|
||||
notice_email_sent: An email was sent to %s
|
||||
notice_email_error: An error occurred while sending mail (%s)"
|
||||
|
||||
mail_subject_lost_password: Вашата парола
|
||||
mail_subject_register: Активация на акаунт
|
||||
|
@ -407,6 +409,7 @@ label_date_from: From
|
|||
label_date_to: To
|
||||
label_language_based: Language based
|
||||
label_sort_by: Sort by "%s"
|
||||
label_send_test_email: Send a test email
|
||||
|
||||
button_login: Вход
|
||||
button_submit: Изпращане
|
||||
|
|
|
@ -69,6 +69,8 @@ notice_file_not_found: Anhang besteht nicht oder ist gelöscht worden.
|
|||
notice_locking_conflict: Datum wurde von einem anderen Benutzer geändert.
|
||||
notice_scm_error: Eintrag und/oder Revision besteht nicht im Projektarchiv.
|
||||
notice_not_authorized: Sie sind nicht berechtigt auf diese Seite zuzugreifen.
|
||||
notice_email_sent: An email was sent to %s
|
||||
notice_email_error: An error occurred while sending mail (%s)"
|
||||
|
||||
mail_subject_lost_password: Ihr redMine Kennwort
|
||||
mail_subject_register: redMine Kontoaktivierung
|
||||
|
@ -407,6 +409,7 @@ label_date_from: Von
|
|||
label_date_to: Bis
|
||||
label_language_based: Language based
|
||||
label_sort_by: Sort by "%s"
|
||||
label_send_test_email: Send a test email
|
||||
|
||||
button_login: Einloggen
|
||||
button_submit: OK
|
||||
|
|
|
@ -69,6 +69,8 @@ notice_file_not_found: The page you were trying to access doesn't exist or has b
|
|||
notice_locking_conflict: Data have been updated by another user.
|
||||
notice_scm_error: Entry and/or revision doesn't exist in the repository.
|
||||
notice_not_authorized: You are not authorized to access this page.
|
||||
notice_email_sent: An email was sent to %s
|
||||
notice_email_error: An error occurred while sending mail (%s)"
|
||||
|
||||
mail_subject_lost_password: Your redMine password
|
||||
mail_subject_register: redMine account activation
|
||||
|
@ -407,6 +409,7 @@ label_date_from: From
|
|||
label_date_to: To
|
||||
label_language_based: Language based
|
||||
label_sort_by: Sort by "%s"
|
||||
label_send_test_email: Send a test email
|
||||
|
||||
button_login: Login
|
||||
button_submit: Submit
|
||||
|
|
|
@ -69,6 +69,8 @@ notice_file_not_found: La página que intentabas tener acceso no existe ni se ha
|
|||
notice_locking_conflict: Data have been updated by another user.
|
||||
notice_scm_error: La entrada y/o la revisión no existe en el depósito.
|
||||
notice_not_authorized: You are not authorized to access this page.
|
||||
notice_email_sent: An email was sent to %s
|
||||
notice_email_error: An error occurred while sending mail (%s)"
|
||||
|
||||
mail_subject_lost_password: Tu contraseña del redMine
|
||||
mail_subject_register: Activación de la cuenta del redMine
|
||||
|
@ -407,6 +409,7 @@ label_date_from: From
|
|||
label_date_to: To
|
||||
label_language_based: Language based
|
||||
label_sort_by: Sort by "%s"
|
||||
label_send_test_email: Send a test email
|
||||
|
||||
button_login: Conexión
|
||||
button_submit: Someter
|
||||
|
|
|
@ -65,10 +65,12 @@ notice_successful_create: Création effectuée avec succès.
|
|||
notice_successful_update: Mise à jour effectuée avec succès.
|
||||
notice_successful_delete: Suppression effectuée avec succès.
|
||||
notice_successful_connection: Connection réussie.
|
||||
notice_file_not_found: La page à laquelle vous souhaitez accéder n'existe pas ou a été supprimée.
|
||||
notice_file_not_found: "La page à laquelle vous souhaitez accéder n'existe pas ou a été supprimée."
|
||||
notice_locking_conflict: Les données ont été mises à jour par un autre utilisateur. Mise à jour impossible.
|
||||
notice_scm_error: L'entrée et/ou la révision demandée n'existe pas dans le dépôt.
|
||||
notice_not_authorized: Vous n'êtes pas autorisés à accéder à cette page.
|
||||
notice_scm_error: "L'entrée et/ou la révision demandée n'existe pas dans le dépôt."
|
||||
notice_not_authorized: "Vous n'êtes pas autorisés à accéder à cette page."
|
||||
notice_email_sent: "Un email a été envoyé à %s"
|
||||
notice_email_error: "Erreur lors de l'envoi de l'email (%s)"
|
||||
|
||||
mail_subject_lost_password: Votre mot de passe redMine
|
||||
mail_subject_register: Activation de votre compte redMine
|
||||
|
@ -407,6 +409,7 @@ label_date_from: Du
|
|||
label_date_to: Au
|
||||
label_language_based: Basé sur la langue
|
||||
label_sort_by: Trier par "%s"
|
||||
label_send_test_email: Envoyer un email de test
|
||||
|
||||
button_login: Connexion
|
||||
button_submit: Soumettre
|
||||
|
|
|
@ -69,6 +69,8 @@ notice_file_not_found: La pagina desiderata non esiste o è stata rimossa.
|
|||
notice_locking_conflict: Le informazioni sono state modificate da un altro utente.
|
||||
notice_scm_error: La risorsa e/o la versione non esistono nel repository.
|
||||
notice_not_authorized: You are not authorized to access this page.
|
||||
notice_email_sent: An email was sent to %s
|
||||
notice_email_error: An error occurred while sending mail (%s)"
|
||||
|
||||
mail_subject_lost_password: Password redMine
|
||||
mail_subject_register: Attivazione utenza redMine
|
||||
|
@ -407,6 +409,7 @@ label_date_from: From
|
|||
label_date_to: To
|
||||
label_language_based: Language based
|
||||
label_sort_by: Sort by "%s"
|
||||
label_send_test_email: Send a test email
|
||||
|
||||
button_login: Login
|
||||
button_submit: Invia
|
||||
|
|
|
@ -70,6 +70,8 @@ notice_file_not_found: アクセスしようとしたページは存在しない
|
|||
notice_locking_conflict: 別のユーザがデータを更新しています。
|
||||
notice_scm_error: リポジトリに、エントリ/リビジョンが存在しません。
|
||||
notice_not_authorized: このページにアクセスするには認証が必要です。
|
||||
notice_email_sent: An email was sent to %s
|
||||
notice_email_error: An error occurred while sending mail (%s)"
|
||||
|
||||
mail_subject_lost_password: redMineパスワード
|
||||
mail_subject_register: redMineアカウントが有効になりました
|
||||
|
@ -408,6 +410,7 @@ label_date_from: From
|
|||
label_date_to: To
|
||||
label_language_based: Language based
|
||||
label_sort_by: Sort by "%s"
|
||||
label_send_test_email: Send a test email
|
||||
|
||||
button_login: ログイン
|
||||
button_submit: 変更
|
||||
|
|
|
@ -69,6 +69,8 @@ notice_file_not_found: De pagina die U probeerde te benaderen bestaat niet of is
|
|||
notice_locking_conflict: De gegevens zijn gewijzigd door een andere gebruiker.
|
||||
notice_scm_error: Deze ingang of revisie bestaat niet in de repository.
|
||||
notice_not_authorized: Het is U niet toegestaan om deze pagina te raadplegen.
|
||||
notice_email_sent: An email was sent to %s
|
||||
notice_email_error: An error occurred while sending mail (%s)"
|
||||
|
||||
mail_subject_lost_password: Uw redMine wachtwoord
|
||||
mail_subject_register: redMine account activatie
|
||||
|
@ -407,6 +409,7 @@ label_date_from: From
|
|||
label_date_to: To
|
||||
label_language_based: Language based
|
||||
label_sort_by: Sort by "%s"
|
||||
label_send_test_email: Send a test email
|
||||
|
||||
button_login: Inloggen
|
||||
button_submit: Toevoegen
|
||||
|
|
|
@ -69,6 +69,8 @@ notice_file_not_found: A pagina que voce esta tentando acessar nao existe ou foi
|
|||
notice_locking_conflict: Os dados foram atualizados por um outro usuario.
|
||||
notice_scm_error: A entrada e/ou a revisao nao existem no repositorio.
|
||||
notice_not_authorized: You are not authorized to access this page.
|
||||
notice_email_sent: An email was sent to %s
|
||||
notice_email_error: An error occurred while sending mail (%s)"
|
||||
|
||||
mail_subject_lost_password: Sua senha do redMine.
|
||||
mail_subject_register: Ativacao de conta do redMine.
|
||||
|
@ -407,6 +409,7 @@ label_date_from: From
|
|||
label_date_to: To
|
||||
label_language_based: Language based
|
||||
label_sort_by: Sort by "%s"
|
||||
label_send_test_email: Send a test email
|
||||
|
||||
button_login: Login
|
||||
button_submit: Enviar
|
||||
|
|
|
@ -69,6 +69,8 @@ notice_file_not_found: A página que você está tentando acessar não existe ou
|
|||
notice_locking_conflict: Os dados foram atualizados por um outro usuário.
|
||||
notice_scm_error: A entrada e/ou a revisão não existem no repositório.
|
||||
notice_not_authorized: Você não está autorizado a acessar esta página.
|
||||
notice_email_sent: An email was sent to %s
|
||||
notice_email_error: An error occurred while sending mail (%s)"
|
||||
|
||||
mail_subject_lost_password: Sua senha do redMine.
|
||||
mail_subject_register: Ativação de conta do redMine.
|
||||
|
@ -407,6 +409,7 @@ label_date_from: From
|
|||
label_date_to: To
|
||||
label_language_based: Language based
|
||||
label_sort_by: Sort by "%s"
|
||||
label_send_test_email: Send a test email
|
||||
|
||||
button_login: Login
|
||||
button_submit: Enviar
|
||||
|
|
|
@ -69,6 +69,8 @@ notice_file_not_found: Sidan du försökte komma åt existerar inte eller har bl
|
|||
notice_locking_conflict: Data har uppdaterats av en annan användare.
|
||||
notice_scm_error: Inlägg och/eller revision finns inte i repositoriet.
|
||||
notice_not_authorized: You are not authorized to access this page.
|
||||
notice_email_sent: An email was sent to %s
|
||||
notice_email_error: An error occurred while sending mail (%s)"
|
||||
|
||||
mail_subject_lost_password: Ditt redMine lösenord
|
||||
mail_subject_register: redMine kontoaktivering
|
||||
|
@ -407,6 +409,7 @@ label_date_from: From
|
|||
label_date_to: To
|
||||
label_language_based: Language based
|
||||
label_sort_by: Sort by "%s"
|
||||
label_send_test_email: Send a test email
|
||||
|
||||
button_login: Logga in
|
||||
button_submit: Skicka
|
||||
|
|
|
@ -72,6 +72,8 @@ notice_file_not_found: 您访问的页面不存在或已被删除。
|
|||
notice_locking_conflict: 数据已被另一个用户更新
|
||||
notice_scm_error: 在版本库中不存在该条目或修订
|
||||
notice_not_authorized: You are not authorized to access this page.
|
||||
notice_email_sent: An email was sent to %s
|
||||
notice_email_error: An error occurred while sending mail (%s)"
|
||||
|
||||
mail_subject_lost_password: 您的redMine口令
|
||||
mail_subject_register: redMine帐户激活
|
||||
|
@ -409,6 +411,7 @@ label_date_from: From
|
|||
label_date_to: To
|
||||
label_language_based: Language based
|
||||
label_sort_by: Sort by "%s"
|
||||
label_send_test_email: Send a test email
|
||||
|
||||
button_login: 登录
|
||||
button_submit: 提交
|
||||
|
|
Loading…
Reference in New Issue