mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 04:56:18 +08:00
attempt to fix the UTF-8 warn in the log, turns out this runs really deep, when you hit deliver in test it clones the mail not setting charset properly, leaving as is for today but fixing prod at least
This commit is contained in:
parent
14f33b80e4
commit
eb085beea8
|
@ -20,6 +20,7 @@ module EmailBuilder
|
|||
body: body
|
||||
}
|
||||
mail_args[:from] = params[:from] || SiteSetting.notification_email
|
||||
mail_args[:charset] = 'UTF-8'
|
||||
mail(mail_args)
|
||||
end
|
||||
|
||||
|
|
|
@ -19,7 +19,8 @@ class EmailSender
|
|||
return if @message.to.blank?
|
||||
return if @message.body.blank?
|
||||
|
||||
plain_body = @message.body.to_s
|
||||
@message.charset = 'UTF-8'
|
||||
plain_body = @message.body.to_s.force_encoding('UTF-8')
|
||||
|
||||
@message.html_part = Mail::Part.new do
|
||||
content_type 'text/html; charset=UTF-8'
|
||||
|
|
|
@ -13,22 +13,12 @@ describe SystemMessage do
|
|||
let(:post) { system_message.create(:welcome_invite) }
|
||||
let(:topic) { post.topic }
|
||||
|
||||
it 'should create a post' do
|
||||
it 'should create a post correctly' do
|
||||
post.should be_present
|
||||
end
|
||||
|
||||
it 'should be a private message' do
|
||||
topic.should be_private_message
|
||||
end
|
||||
|
||||
it 'should have the correct topic subtype' do
|
||||
topic.subtype.should == TopicSubtype.system_message
|
||||
end
|
||||
|
||||
it 'should be visible by the user' do
|
||||
topic.allowed_users.include?(user).should be_true
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context '#system_user' do
|
||||
|
|
Loading…
Reference in New Issue
Block a user