banana_peels 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/banana_peels/api.rb +8 -1
- data/lib/banana_peels/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab510d70eff8e9b4fc3c9c694e9cde4c0116007c
|
4
|
+
data.tar.gz: 496bf5868778724e652eed10b51b2f17584573a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45f2a20f026d01a14b59070c52d03e81821a96e4a5f9616cce7b014f84aca7129a929213fe6e108740ebfb3e5dd9f7ec04e1d1c0480392ac81f22b9975e0d870
|
7
|
+
data.tar.gz: 18ed6514a7e092bee4e65942b3686d950865481977794b6ed4c98fc11370c0156f1c91fb9c566ae9a610adb4a78cf4cdc369067b4a271a68eafe948db7b33bd6
|
data/lib/banana_peels/api.rb
CHANGED
@@ -27,9 +27,16 @@ module BananaPeels
|
|
27
27
|
end
|
28
28
|
|
29
29
|
# Use this instead of #mail() in ActionMailer.
|
30
|
+
# Also allows :from_name, :from_email to be specified independently
|
31
|
+
# as mail_options as opposed to just :from.
|
30
32
|
def mail(mailer, campaign_id, mail_options, merge_tags, api_key)
|
31
33
|
c = campaign(campaign_id, merge_tags, api_key)
|
32
|
-
|
34
|
+
headers = c.default_mail_options.merge(mail_options)
|
35
|
+
# Adjust from address.
|
36
|
+
if !mail_options[:from] && (mail_options[:from_name] || mail_options[:from_email])
|
37
|
+
headers[:from] = email_with_name(mail_options[:from_name] || c.from_name, mail_options[:from_email] || c.from_email)
|
38
|
+
end
|
39
|
+
mailer.mail(headers) do |format|
|
33
40
|
format.text { mailer.render text: c.text_content }
|
34
41
|
format.html(content_transfer_encoding: 'quoted-printable') do
|
35
42
|
mailer.render text: [c.html_content].pack('M')
|
data/lib/banana_peels/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: banana_peels
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Bull
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
78
|
version: '0'
|
79
79
|
requirements: []
|
80
80
|
rubyforge_project:
|
81
|
-
rubygems_version: 2.0.
|
81
|
+
rubygems_version: 2.0.14
|
82
82
|
signing_key:
|
83
83
|
specification_version: 4
|
84
84
|
summary: Interface for using MailChimp as a template repository for transactional
|