Project

General

Profile

Patch #2029 » plain-text-mail.patch

Yuki Sonoda, 2008-10-14 12:37

View differences:

app/models/mailer.rb
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_only_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
app/views/settings/_notifications.rhtml
<%= hidden_field_tag 'settings[bcc_recipients]', 0 %></p>
</div>
<div class="box tabular">
<p><label><%= l(:setting_plain_only_mail) %></label>
<%= check_box_tag 'settings[plain_only_mail]', 1, Setting.plain_only_mail? %>
<%= hidden_field_tag 'settings[plain_only_mail]', 0 %></p>
</div>
<fieldset class="box" id="notified_events"><legend><%=l(:text_select_mail_notifications)%></legend>
<% @notifiables.each do |notifiable| %>
<label><%= check_box_tag 'settings[notified_events][]', notifiable, Setting.notified_events.include?(notifiable) %>
config/settings.yml
default: redmine@example.net
bcc_recipients:
default: 1
plain_only_mail:
default: 0
text_formatting:
default: textile
wiki_compression:
lang/en.yml
setting_issues_export_limit: Issues export limit
setting_mail_from: Emission email address
setting_bcc_recipients: Blind carbon copy recipients (bcc)
setting_plain_only_mail: plain text only (no HTML)
setting_host_name: Host name
setting_text_formatting: Text formatting
setting_wiki_compression: Wiki history compression
lang/ja.yml
field_time_zone: タイムゾーン
text_caracters_minimum: 最低%d文字の長さが必要です
setting_bcc_recipients: ブラインドカーボンコピーで受信(bcc)
setting_plain_only_mail: プレインテキストのみ(HTMLなし)
button_annotate: 注釈
label_issues_by: %s別のチケット
field_searchable: Searchable
    (1-1/1)