Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
473674a2
Commit
473674a2
authored
Apr 03, 2019
by
Heinrich Lee Yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent premailer from converting HTML entities
This prevents `&mdash` in our templates being change to `-`
parent
bc696947
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletion
+20
-1
changelogs/unreleased/55964-fix-email-encoding.yml
changelogs/unreleased/55964-fix-email-encoding.yml
+5
-0
config/initializers/premailer.rb
config/initializers/premailer.rb
+2
-1
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+13
-0
No files found.
changelogs/unreleased/55964-fix-email-encoding.yml
0 → 100644
View file @
473674a2
---
title
:
Fix notfication emails having wrong encoding
merge_request
:
26931
author
:
type
:
fixed
config/initializers/premailer.rb
View file @
473674a2
...
...
@@ -4,5 +4,6 @@ Premailer::Rails.config.merge!(
preserve_styles:
true
,
remove_comments:
true
,
remove_ids:
false
,
remove_scripts:
false
remove_scripts:
false
,
output_encoding:
'US-ASCII'
)
spec/mailers/notify_spec.rb
View file @
473674a2
...
...
@@ -30,6 +30,19 @@ describe Notify do
description:
'My awesome description!'
)
end
describe
'with HTML-encoded entities'
do
before
do
described_class
.
test_email
(
'test@test.com'
,
'Subject'
,
'Some body with —'
).
deliver
end
subject
{
ActionMailer
::
Base
.
deliveries
.
last
}
it
'retains 7bit encoding'
do
expect
(
subject
.
body
.
ascii_only?
).
to
eq
(
true
)
expect
(
subject
.
body
.
encoding
).
to
eq
(
'7bit'
)
end
end
context
'for a project'
do
shared_examples
'an assignee email'
do
it
'is sent to the assignee as the author'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment