mandriller 0.0.5 → 0.0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7c351e2c133134f9ea0c40bf558e28bae8eda5cd
4
- data.tar.gz: 9607f04622e8fc70d7a98728b85a569fd2903056
3
+ metadata.gz: c57d0cef20fb012f1d81d456f5fd1d672ffe29c7
4
+ data.tar.gz: f648f0400cbf9955bf54ff1a52f33480219e547a
5
5
  SHA512:
6
- metadata.gz: 847fc944af9d6d500cd654c6e73958b9f2ea7b4a43f64df91ad07372590add7e8bfe521f8c50a6ceba9ae8e4cce6c3bc6a15ad38d3e0e4445f57ea82724e45b3
7
- data.tar.gz: dd405529ef25b90f52d642ed2458f9da2eaad014efeb70c985b923b52c32549345ed1df5491cbab938769ee1901aa3d67ea7018eba42a9e7a8626034c6096adc
6
+ metadata.gz: d1e81dba186fe87e613128cf97b7abc1b020454037b3beefd75fcee4323476fa9bc66803cab7b026c8b00cd0e4002da96ae7e63011a7f169e1a46a203ad2c20a
7
+ data.tar.gz: a7d2e3e3149847839731f4347bf9d51fe67f48043fa71efe840964632f3d3a2c41735dd0dd83a3681352c1dd8cf02d1754d25a3b1a44269b2f8638d111738aa8
data/README.md CHANGED
@@ -15,17 +15,38 @@ gem "mandriller"
15
15
 
16
16
  And run `bundle install`.
17
17
 
18
+ Add the following into any environment's settings in `config/environments/`.
19
+
20
+ ```ruby
21
+ config.action_mailer.delivery_method = :smtp
22
+ config.action_mailer.smtp_settings = {
23
+ :user_name => 'UserName',
24
+ :password => 'Password',
25
+ :address => "smtp.mandrillapp.com",
26
+ :domain => "your-domain.com",
27
+ :enable_starttls_auto => true,
28
+ :authentication => 'login',
29
+ :port => 587,
30
+ }
31
+ ```
32
+
18
33
  ## Usage
19
34
 
20
35
  e.g.
21
36
 
22
37
  ```ruby
23
38
  class UserMailer < Mandriller::Base
39
+ include AbstractController::Callbacks # To use before_filter in ActionMailer::Base
40
+
24
41
  set_open_track
25
42
  set_click_track
43
+ set_google_analytics Settings.root_host, Settings.admin.host
26
44
 
27
- def test_mail
45
+ before_filter do
28
46
  set_google_analytics_campaign "#{mailer_name.gsub(/_mailer$/, '')}/#{action_name.gsub(/_email$/, '')}"
47
+ end
48
+
49
+ def test_mail
29
50
  mail from: 'from@example.com', to: 'to@example.com'
30
51
  end
31
52
  end
@@ -39,145 +60,147 @@ You can set the options globally and locally. Locally set option overwrites the
39
60
 
40
61
  Enable open-tracking for the message.
41
62
 
42
- `set_open_track` or `set_open_track true`: Enable
43
- `set_open_track false`: Disable
63
+ - `set_open_track` or `set_open_track true`: Enable
64
+ - `set_open_track false`: Disable
44
65
 
45
66
  ### set_click_track
46
67
 
47
68
  Enable click-tracking for the message.
48
69
 
49
- `set_click_track 'all'`: enables click tracking on all emails
50
- `set_click_track 'htmlonly'`: enables click tracking only on html emails
51
- `set_click_track 'textonly'`: enables click tracking only on text emails
70
+ - `set_click_track 'all'`: enables click tracking on all emails
71
+ - `set_click_track 'htmlonly'`: enables click tracking only on html emails
72
+ - `set_click_track 'textonly'`: enables click tracking only on text emails
52
73
 
53
74
  ### set_auto_text
54
75
 
55
76
  Automatically generate a plain-text version of the email from the HTML content.
56
77
 
57
- `set_auto_text` or `set_auto_text true`: Enable
58
- `set_auto_text false`: Disable
78
+ - `set_auto_text` or `set_auto_text true`: Enable
79
+ - `set_auto_text false`: Disable
59
80
 
60
81
  ### set_auto_html
61
82
 
62
83
  Automatically generate an HTML version of the email from the plain-text content.
63
84
 
64
- `set_auto_html` or `set_auto_html true`: Enable
65
- `set_auto_html false`: Disable
85
+ - `set_auto_html` or `set_auto_html true`: Enable
86
+ - `set_auto_html false`: Disable
66
87
 
67
88
  ### set_template
68
89
 
69
90
  Use an HTML template stored in your Mandrill account
70
91
 
71
- `set_auto_html 'template_name'` or `set_auto_html 'template_name', 'block_name'`:
92
+ - `set_auto_html 'template_name'` or `set_auto_html 'template_name', 'block_name'`:
72
93
 
73
94
  `template_name`
95
+
74
96
  the name of the stored template.
75
97
 
76
98
  `block_name`
99
+
77
100
  the name of the mc:edit region where the body of the SMTP generated message will be placed. Optional and defaults to "main".
78
101
 
79
102
  ### set_merge_vars
80
103
 
81
104
  Add dynamic data to replace mergetags that appear in your message content.
82
105
 
83
- `set_merge_vars {foo: 1, bar: 2}`
106
+ - `set_merge_vars {foo: 1, bar: 2}`
84
107
 
85
108
  ### set_google_analytics
86
109
 
87
110
  Add Google Analytics tracking to links in your email for the specified domains.
88
111
 
89
- `set_google_analytics 'foo.com', 'bar.com'`
112
+ - `set_google_analytics 'foo.com', 'bar.com'`
90
113
 
91
114
  ### set_google_analytics_campaign
92
115
 
93
116
  Add an optional value to be used for the __utm_campaign parameter__ in Google Analytics tracked links.
94
117
 
95
- `set_google_analytics 'campaign_name'`
118
+ - `set_google_analytics 'campaign_name'`
96
119
 
97
120
  ### set_metadata
98
121
 
99
122
  Information about any custom fields or data you want to append to the message.
100
123
 
101
- `set_metadata {foo: 1, bar: 2}`
124
+ - `set_metadata {foo: 1, bar: 2}`
102
125
 
103
126
  ### set_url_strip_qs
104
127
 
105
128
  Whether to strip querystrings from links for reporting.
106
129
 
107
- `set_url_strip_qs` or `set_url_strip_qs true`: Enable
108
- `set_url_strip_qs false`: Disable
130
+ - `set_url_strip_qs` or `set_url_strip_qs true`: Enable
131
+ - `set_url_strip_qs false`: Disable
109
132
 
110
133
  ### set_preserve_recipients
111
134
 
112
135
  Whether to show recipients of the email other recipients, such as those in the "cc" field.
113
136
 
114
- `set_preserve_recipients` or `set_preserve_recipients true`: Enable
115
- `set_preserve_recipients false`: Disable
137
+ - `set_preserve_recipients` or `set_preserve_recipients true`: Enable
138
+ - `set_preserve_recipients false`: Disable
116
139
 
117
140
  ### set_inline_css
118
141
 
119
142
  Whether to inline the CSS for the HTML version of the email (only for HTML documents less than 256KB).
120
143
 
121
- `set_inline_css` or `set_inline_css true`: Enable
122
- `set_inline_css false`: Disable
144
+ - `set_inline_css` or `set_inline_css true`: Enable
145
+ - `set_inline_css false`: Disable
123
146
 
124
147
  ### set_tracking_domain
125
148
 
126
149
  Set a [custom domain to use for tracking opens and clicks](http://help.mandrill.com/entries/23353682-Can-I-customize-the-domain-used-for-open-and-click-tracking-) instead of mandrillapp.com.
127
150
 
128
- `set_tracking_domain` or `set_tracking_domain true`: Enable
129
- `set_tracking_domain false`: Disable
151
+ - `set_tracking_domain` or `set_tracking_domain true`: Enable
152
+ - `set_tracking_domain false`: Disable
130
153
 
131
154
  ### set_signing_domain
132
155
 
133
156
  Set a [custom domain to use for SPF/DKIM signing](http://help.mandrill.com/entries/23374656-Can-I-send-emails-on-behalf-of-my-clients-) instead of mandrill (for "via" or "on behalf of" in email clients).
134
157
 
135
- `set_signing_domain` or `set_signing_domain true`: Enable
136
- `set_signing_domain false`: Disable
158
+ - `set_signing_domain` or `set_signing_domain true`: Enable
159
+ - `set_signing_domain false`: Disable
137
160
 
138
161
  ### set_subaccount
139
162
 
140
163
  Select a [subaccount](http://help.mandrill.com/entries/25523278-What-are-subaccounts-) for sending the mail.
141
164
 
142
- `set_subaccount 'subaccount_id'`
165
+ - `set_subaccount 'subaccount_id'`
143
166
 
144
167
  ### set_view_content_link
145
168
 
146
169
  Control whether the View Content link appears for emails sent for your account.
147
170
 
148
- `set_view_content_link` or `set_view_content_link true`: Enable
149
- `set_view_content_link false`: Disable
171
+ - `set_view_content_link` or `set_view_content_link true`: Enable
172
+ - `set_view_content_link false`: Disable
150
173
 
151
174
  ### set_bcc_address
152
175
 
153
176
  An optional address that will receive an exact copy of the message, including all tracking data
154
177
 
155
- `set_bcc_address 'email_address'`
178
+ - `set_bcc_address 'email_address'`
156
179
 
157
180
  ### set_important
158
181
 
159
182
  Whether this message is [important](http://help.mandrill.com/entries/23664027-Does-Mandrill-allow-me-to-prioritize-messages-) and should be delivered ahead of non-important messages
160
183
 
161
- `set_important` or `set_important true`: Enable
162
- `set_important false`: Disable
184
+ - `set_important` or `set_important true`: Enable
185
+ - `set_important false`: Disable
163
186
 
164
187
  ### set_ip_pool
165
188
 
166
189
  Specify a [dedicated IP pool](http://help.mandrill.com/entries/24182062-Can-I-choose-which-dedicated-IP-pool-my-Mandrill-emails-send-from-) for the message.
167
190
 
168
- `set_ip_pool 'dedicated_ip_pool'`
191
+ - `set_ip_pool 'dedicated_ip_pool'`
169
192
 
170
193
  ### set_retun_path_domain
171
194
 
172
195
  Specify a [custom domain](http://help.mandrill.com/entries/25241243-Can-I-customize-the-Return-Path-bounce-address-used-for-my-emails-) to use for the message's return-path
173
196
 
174
- `set_return_path_domain 'example.com'`
197
+ - `set_return_path_domain 'example.com'`
175
198
 
176
199
  ### set_send_at
177
200
 
178
201
  Specify a future date/time that the message should be [scheduled](http://help.mandrill.com/entries/24331201-Can-I-schedule-a-message-to-send-at-a-specific-time-) for delivery
179
202
 
180
- `set_send_at 5.days.from_now`
203
+ - `set_send_at 5.days.from_now`
181
204
 
182
205
  __Only available for paid accounts__
183
206
 
@@ -37,7 +37,7 @@ class Mandriller::Base < ActionMailer::Base
37
37
  class_attribute :mandrill_template, :mandrill_google_analytics
38
38
 
39
39
  class << self
40
- def set_template(template_name, block_name)
40
+ def set_template(template_name, block_name = nil)
41
41
  self.mandrill_template = [template_name, block_name]
42
42
  end
43
43
 
@@ -1,3 +1,3 @@
1
1
  module Mandriller
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mandriller
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daisuke Taniwaki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-28 00:00:00.000000000 Z
11
+ date: 2014-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionmailer