body[:content_for_layout] = render(:file => method_name, :body => body)
ActionView::Base.new(template_root, body, self).render(:file => "mailer/#{layout}", :use_full_path => true)
end
+
+ # for the case of plain text only
+ def body(*params)
+ value = super(*params)
+ if Setting.plain_text_mail?
+ templates = Dir.glob("#{template_path}/#{@template}.text.plain.{rhtml,erb}")
+ unless String === @body or templates.empty?
+ template = File.basename(templates.first)
+ @body[:content_for_layout] = render(:file => template, :body => @body)
+ @body = ActionView::Base.new(template_root, @body, self).render(:file => "mailer/layout.text.plain.rhtml", :use_full_path => true)
+ return @body
+ end
+ end
+ return value
+ end
# Makes partial rendering work with Rails 1.2 (retro-compatibility)
def self.controller_path
<p><label><%= l(:setting_bcc_recipients) %></label>
<%= check_box_tag 'settings[bcc_recipients]', 1, Setting.bcc_recipients? %>
<%= hidden_field_tag 'settings[bcc_recipients]', 0 %></p>
+
+<p><label><%= l(:setting_plain_text_mail) %></label>
+<%= check_box_tag 'settings[plain_text_mail]', 1, Setting.plain_text_mail? %>
+<%= hidden_field_tag 'settings[plain_text_mail]', 0 %></p>
</div>
<fieldset class="box" id="notified_events"><legend><%=l(:text_select_mail_notifications)%></legend>
default: redmine@example.net
bcc_recipients:
default: 1
+plain_text_mail:
+ default: 0
text_formatting:
default: textile
wiki_compression:
notice_unable_delete_version: Unable to delete version
label_renamed: renamed
label_copied: copied
+setting_plain_text_mail: plain text only (no HTML)
enumeration_issue_priorities: Prioritat dels assumptes
enumeration_doc_categories: Categories del document
enumeration_activities: Activitats (seguidor de temps)
+setting_plain_text_mail: plain text only (no HTML)
notice_unable_delete_version: Unable to delete version
label_renamed: renamed
label_copied: copied
+setting_plain_text_mail: plain text only (no HTML)
enumeration_issue_priorities: Sagsprioriteter
enumeration_doc_categories: Dokumentkategorier
enumeration_activities: Aktiviteter (tidsregistrering)
+setting_plain_text_mail: plain text only (no HTML)
enumeration_issue_priorities: Ticket-Prioritäten
enumeration_doc_categories: Dokumentenkategorien
enumeration_activities: Aktivitäten (Zeiterfassung)
+setting_plain_text_mail: plain text only (no HTML)
setting_issues_export_limit: Issues export limit
setting_mail_from: Emission email address
setting_bcc_recipients: Blind carbon copy recipients (bcc)
+setting_plain_text_mail: plain text mail (no HTML)
setting_host_name: Host name
setting_text_formatting: Text formatting
setting_wiki_compression: Wiki history compression
notice_unable_delete_version: Unable to delete version
label_renamed: renamed
label_copied: copied
+setting_plain_text_mail: plain text only (no HTML)
notice_unable_delete_version: Unable to delete version
label_renamed: renamed
label_copied: copied
+setting_plain_text_mail: plain text only (no HTML)
enumeration_doc_categories: Catégories des documents
enumeration_activities: Activités (suivi du temps)
notice_unable_delete_version: Unable to delete version
+setting_plain_text_mail: mail texte brut (non HTML)
notice_unable_delete_version: Unable to delete version
label_renamed: renamed
label_copied: copied
+setting_plain_text_mail: plain text only (no HTML)
notice_unable_delete_version: A verziót nem lehet törölni
label_renamed: átnevezve
label_copied: lemásolva
+setting_plain_text_mail: plain text only (no HTML)
notice_unable_delete_version: Impossibile cancellare la versione
label_renamed: rinominato
label_copied: copiato
+setting_plain_text_mail: plain text only (no HTML)
field_time_zone: タイムゾーン
text_caracters_minimum: 最低%d文字の長さが必要です
setting_bcc_recipients: ブラインドカーボンコピーで受信(bcc)
+setting_plain_text_mail: プレインテキストのみ(HTMLなし)
button_annotate: 注釈
label_issues_by: %s別のチケット
field_searchable: Searchable
notice_unable_delete_version: 삭제 할 수 없는 버전 입니다.
label_renamed: renamed
label_copied: copied
+setting_plain_text_mail: plain text only (no HTML)
notice_unable_delete_version: Neimanoma panaikinti versiją
label_renamed: pervardintas
label_copied: nukopijuotas
+setting_plain_text_mail: plain text only (no HTML)
setting_sequential_project_identifiers: Genereer sequentiële projectidentiteiten
notice_unable_delete_version: Niet mogelijk om deze versie te verwijderen.
label_renamed: hernoemd
-label_copied: gekopieerd
\ No newline at end of file
+label_copied: gekopieerd
+setting_plain_text_mail: plain text only (no HTML)
notice_unable_delete_version: Unable to delete version
label_renamed: renamed
label_copied: copied
+setting_plain_text_mail: plain text only (no HTML)
label_copied: skopiowano
field_vf_watcher: Obserwator
field_vf_personnel: Personel
+setting_plain_text_mail: plain text only (no HTML)
notice_unable_delete_version: Não foi possível excluir a versão
label_renamed: renomeado\r
label_copied: copiado
+setting_plain_text_mail: plain text only (no HTML)
enumeration_issue_priorities: Prioridade de tarefas
enumeration_doc_categories: Categorias de documentos
enumeration_activities: Actividades (Contagem de tempo)
+setting_plain_text_mail: plain text only (no HTML)
notice_unable_delete_version: Unable to delete version
label_renamed: renamed
label_copied: copied
+setting_plain_text_mail: plain text only (no HTML)
text_wiki_destroy_confirmation: Вы уверены, что хотите удалить данную Wiki и все содержимое?
text_workflow_edit: Выберите роль и трекер для редактирования последовательности состояний
+setting_plain_text_mail: plain text only (no HTML)
notice_unable_delete_version: Unable to delete version
label_renamed: renamed
label_copied: copied
+setting_plain_text_mail: plain text only (no HTML)
notice_unable_delete_version: Unable to delete version
label_renamed: renamed
label_copied: copied
+setting_plain_text_mail: plain text only (no HTML)
notice_unable_delete_version: Unable to delete version
label_renamed: renamed
label_copied: copied
+setting_plain_text_mail: plain text only (no HTML)
notice_unable_delete_version: Unable to delete version
label_renamed: renamed
label_copied: copied
+setting_plain_text_mail: plain text only (no HTML)
notice_unable_delete_version: Unable to delete version
label_renamed: renamed
label_copied: copied
+setting_plain_text_mail: plain text only (no HTML)
enumeration_issue_priorities: 項目優先權
enumeration_doc_categories: 文件分類
enumeration_activities: 活動 (時間追蹤)
+setting_plain_text_mail: plain text only (no HTML)
enumeration_issue_priorities: 问题优先级
enumeration_doc_categories: 文档类别
enumeration_activities: 活动(时间跟踪)
+setting_plain_text_mail: plain text only (no HTML)
assert_kind_of TMail::Mail, mail
# link to the main ticket
assert mail.body.include?('<a href="https://mydomain.foo/issues/show/1">Bug #1: Can\'t print recipes</a>')
-
+
# link to a referenced ticket
assert mail.body.include?('<a href="https://mydomain.foo/issues/show/2" class="issue" title="Add ingredients categories (Assigned)">#2</a>')
# link to a changeset
assert mail.body.include?('<a href="https://mydomain.foo/repositories/revision/ecookbook/2" class="changeset" title="This commit fixes #1, #2 and references #1 & #3">r2</a>')
end
+
+ def test_plain_text_mail
+ Setting.plain_text_mail = 1
+ journal = Journal.find(2)
+ Mailer.deliver_issue_edit(journal)
+ mail = ActionMailer::Base.deliveries.last
+ assert !mail.body.include?('<a href="https://mydomain.foo/issues/show/1">Bug #1: Can\'t print recipes</a>')
+ end
+
+
# test mailer methods for each language
def test_issue_add