nifty-email 0.0.2 → 0.0.3
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 +4 -4
- data/README.md +19 -0
- data/lib/nifty-email.rb +1 -1
- data/lib/nifty-email/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 265b030cebf93aea24952d570bf5de1e3bd26c4e
|
4
|
+
data.tar.gz: 0deb03aa77c8bcf9c881c4c29fad947deed678ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7804c868170a9ef6dc7b1f3be795c8d01e156665e109df9532865e8143884d6d42bba84f5526072be706f97cccdb2c1546810d82159bb504ec86a84e1377a6a2
|
7
|
+
data.tar.gz: b37741dd57fcace6981a665f50e192054a76c835b0fa14755ec0e23ba13fd6ec2a9a9f6a6f0a88e6c1ba5f6d8a23fb50712c730379e93a2a86c4db62bb378162
|
data/README.md
CHANGED
@@ -18,6 +18,8 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
+
### General example
|
22
|
+
|
21
23
|
```
|
22
24
|
NiftyEmail.token = '123abc'
|
23
25
|
|
@@ -26,6 +28,23 @@ puts email.html
|
|
26
28
|
puts email.text
|
27
29
|
```
|
28
30
|
|
31
|
+
### Rails example
|
32
|
+
|
33
|
+
```
|
34
|
+
# initializer
|
35
|
+
|
36
|
+
NiftyEmail.token = '123abc'
|
37
|
+
|
38
|
+
# mailer
|
39
|
+
|
40
|
+
email = NiftyEmail.get_email('awesome-email', full_name: 'Jim Tom')
|
41
|
+
|
42
|
+
mail(to: 'jimtom@example.com', subject: 'Welcome!') do |format|
|
43
|
+
format.html { email.html }
|
44
|
+
format.text { email.text }
|
45
|
+
end
|
46
|
+
```
|
47
|
+
|
29
48
|
## Contributing
|
30
49
|
|
31
50
|
1. Fork it ( https://github.com/[my-github-username]/nifty-email/fork )
|
data/lib/nifty-email.rb
CHANGED
@@ -9,7 +9,7 @@ class NiftyEmail
|
|
9
9
|
@token
|
10
10
|
end
|
11
11
|
|
12
|
-
def self.get_email(slug_or_id, placeholders)
|
12
|
+
def self.get_email(slug_or_id, placeholders = {})
|
13
13
|
connection = Faraday.new(url: 'http://nifty-email-production.herokuapp.com/api/emails')
|
14
14
|
connection.authorization('Token', token: @token)
|
15
15
|
|
data/lib/nifty-email/version.rb
CHANGED