actionmailer-html2text 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +13 -5
- data/README.md +97 -0
- data/lib/actionmailer-html2text/version.rb +1 -1
- metadata +19 -18
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MmZlZjQ1OWJhNmIxZDk5YmY2Njg0Y2QxNGEwZTAwZmViYzEzMThkZg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
OTM3OTJiYjkxNGQ4MzU1MWI0ZWE4NmExMWYxMmIxYTgyZGY3ZGM0ZQ==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NzBlYjdmMzY0ZDAwN2Q4YWIyZTdlNzc5YWQ2ZThiMzMwNjRmNzM4NmE1NjZj
|
10
|
+
Y2I1ZDQ5MDZjMGYxNzE3MmUwMDA1M2Y0N2YyNWY1YzMyZjZhNWMyYTZlZGRm
|
11
|
+
ZGQ4NjJkNTY3ZmJmNjM1MGI4ZWVjZWNmYzhiNDY5OGFlNmIwYTk=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
OWVkNWMxNDMyY2M1Nzg1NTNlOGQ1OGE4OTAzYzdhNTBmYWEzNmRmMmNkMDY4
|
14
|
+
MDRiYmRkMjQyNjc3YTIxNzhlZDExMDVmZGNlY2YwZTA1ZGRhOTVmZTAxYjMx
|
15
|
+
YzgxYTE5NjFlODFmY2MwNWI5ODU0MTg1NzY0MmE3Y2JmYzczZjM=
|
data/README.md
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
actionmailer-html2text [](https://travis-ci.org/soundasleep/actionmailer-html2text)
|
2
|
+
======================
|
3
|
+
|
4
|
+
`actionmailer-html2text` automatically adds plain text parts to HTML emails sent by ActionMailer, using [html2text](https://github.com/soundasleep/html2text_ruby), and inspired by [this blog post](http://artsy.github.io/blog/2012/05/16/generating-automatic-plain-text-mime-parts-with-rails-actionmailer/).
|
5
|
+
|
6
|
+
For example:
|
7
|
+
|
8
|
+
```html
|
9
|
+
<html>
|
10
|
+
<title>Ignored Title</title>
|
11
|
+
<body>
|
12
|
+
<h1>Hello, World!</h1>
|
13
|
+
|
14
|
+
<p>This is some e-mail content.
|
15
|
+
Even though it has whitespace and newlines, the e-mail converter
|
16
|
+
will handle it correctly.
|
17
|
+
|
18
|
+
<p>Even mismatched tags.</p>
|
19
|
+
|
20
|
+
<div>A div</div>
|
21
|
+
<div>Another div</div>
|
22
|
+
<div>A div<div>within a div</div></div>
|
23
|
+
|
24
|
+
<a href="http://foo.com">A link</a>
|
25
|
+
|
26
|
+
</body>
|
27
|
+
</html>
|
28
|
+
```
|
29
|
+
|
30
|
+
Will be converted into:
|
31
|
+
|
32
|
+
```text
|
33
|
+
Hello, World!
|
34
|
+
|
35
|
+
This is some e-mail content. Even though it has whitespace and newlines, the e-mail converter will handle it correctly.
|
36
|
+
|
37
|
+
Even mismatched tags.
|
38
|
+
A div
|
39
|
+
Another div
|
40
|
+
A div
|
41
|
+
within a div
|
42
|
+
[A link](http://foo.com)
|
43
|
+
```
|
44
|
+
|
45
|
+
## Notes
|
46
|
+
|
47
|
+
1. Any existing `text/plain` parts will not be overwritten, so you can still create custom text parts with `template.text.erb` and `template.html.erb`
|
48
|
+
|
49
|
+
1. Any HTML email emails processed will become multipart in order to add the `text/plain` part.
|
50
|
+
|
51
|
+
1. [Issues](https://github.com/soundasleep/actionmailer-html2text/issues) and [pull requests](https://github.com/soundasleep/actionmailer-html2text/pulls) welcome!
|
52
|
+
|
53
|
+
## Installing
|
54
|
+
|
55
|
+
Add [the gem](https://rubygems.org/gems/actionmailer-html2text) into your Gemfile and run `bundle install`:
|
56
|
+
|
57
|
+
```ruby
|
58
|
+
gem 'actionmailer-html2text'
|
59
|
+
```
|
60
|
+
|
61
|
+
You can now enable automatic text parts on just a single mailer:
|
62
|
+
|
63
|
+
```ruby
|
64
|
+
class WelcomeMailer < ApplicationMailer
|
65
|
+
include ActionMailer::Html2Text # Just add this
|
66
|
+
|
67
|
+
def welcome_email(to)
|
68
|
+
mail(to: to, subject: "Subject")
|
69
|
+
end
|
70
|
+
end
|
71
|
+
```
|
72
|
+
|
73
|
+
Or you can add it to _all_ of your mailers:
|
74
|
+
|
75
|
+
```ruby
|
76
|
+
class ApplicationMailer < ActionMailer::Base
|
77
|
+
include ActionMailer::Html2Text # Just add this
|
78
|
+
|
79
|
+
default from: "from@example.com"
|
80
|
+
layout 'mailer'
|
81
|
+
end
|
82
|
+
```
|
83
|
+
|
84
|
+
## Tests
|
85
|
+
|
86
|
+
```
|
87
|
+
bundle install
|
88
|
+
rspec
|
89
|
+
```
|
90
|
+
|
91
|
+
## License
|
92
|
+
|
93
|
+
`actionmailer-html2text` is licensed under MIT.
|
94
|
+
|
95
|
+
## Other versions
|
96
|
+
|
97
|
+
1. [openclerk/emails](https://github.com/openclerk/emails) is a PHP e-mail framework that automatically generates text multiparts
|
metadata
CHANGED
@@ -1,97 +1,97 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionmailer-html2text
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jevon Wright
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: html2text
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.2.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.2.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: actionmailer
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ! '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ! '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ! '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ! '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec-collection_matchers
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ! '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: colorize
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ! '>='
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ! '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rake
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ! '>='
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ! '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
description: Automatically add plain text parts into HTML emails sent by ActionMailer.
|
@@ -102,6 +102,7 @@ extensions: []
|
|
102
102
|
extra_rdoc_files: []
|
103
103
|
files:
|
104
104
|
- LICENSE.md
|
105
|
+
- README.md
|
105
106
|
- lib/actionmailer-html2text.rb
|
106
107
|
- lib/actionmailer-html2text/version.rb
|
107
108
|
- spec/html2text_spec.rb
|
@@ -121,12 +122,12 @@ require_paths:
|
|
121
122
|
- lib
|
122
123
|
required_ruby_version: !ruby/object:Gem::Requirement
|
123
124
|
requirements:
|
124
|
-
- -
|
125
|
+
- - ! '>='
|
125
126
|
- !ruby/object:Gem::Version
|
126
127
|
version: '0'
|
127
128
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
129
|
requirements:
|
129
|
-
- -
|
130
|
+
- - ! '>='
|
130
131
|
- !ruby/object:Gem::Version
|
131
132
|
version: '0'
|
132
133
|
requirements: []
|