banana_peels 0.0.4 → 0.0.5

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: d496c00442e99cceb25125e34e1b563c8a996920
4
- data.tar.gz: ecfb95b989127e25e0328818be5ec2715ff6acd6
3
+ metadata.gz: ab510d70eff8e9b4fc3c9c694e9cde4c0116007c
4
+ data.tar.gz: 496bf5868778724e652eed10b51b2f17584573a4
5
5
  SHA512:
6
- metadata.gz: 67f36969ca122132824e302942a95674412eea447fe6ba746f926bec755620efe53938d674b9138c95e05db988c2d6268ef44bb51f6f0cfd36a0ecb54469f017
7
- data.tar.gz: e9f461e828f8dc6b6865b961744013efa3ffdf2f6af6c4c8535aca001d456971e010124aa1ff1e689bd00e5bac0209be20611f0c6b46ac9c9d9b453ca0b4eebc
6
+ metadata.gz: 45f2a20f026d01a14b59070c52d03e81821a96e4a5f9616cce7b014f84aca7129a929213fe6e108740ebfb3e5dd9f7ec04e1d1c0480392ac81f22b9975e0d870
7
+ data.tar.gz: 18ed6514a7e092bee4e65942b3686d950865481977794b6ed4c98fc11370c0156f1c91fb9c566ae9a610adb4a78cf4cdc369067b4a271a68eafe948db7b33bd6
@@ -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
- mailer.mail(c.default_mail_options.merge(mail_options)) do |format|
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')
@@ -1,3 +1,3 @@
1
1
  module BananaPeels
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
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
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-10-16 00:00:00.000000000 Z
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.3
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