bootstrap-email 1.7.0 → 1.8.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af4f28b1a2fa40f3a861f83e6e816ac561b3a9f458eea687f54e02066a3d587b
4
- data.tar.gz: de4bc2816167bb1d57b9a3075debc44c2cf981048d4cfbdd8b3999b673d78476
3
+ metadata.gz: 5dac3404a2b0e1ea4f18290c2275e22dff41c9f04299b02098c9ad7d6558ea93
4
+ data.tar.gz: 49d3d4a4061fd8c9420cd662340c33b7fc3384b03d497c071c63f99ce56d5dbe
5
5
  SHA512:
6
- metadata.gz: e9561a847b402c882897680695d56bd4d226ec40e331d29df3d49ced0405964372304ee631646a4e70af1d216cdde01f674f742dcb906e0eae59909362d635c6
7
- data.tar.gz: 25ee5b14236ea8d58228a5bfc95b0d2b4bbc2c75e63daab5b818414bc0d02c336a5ca49718adbf3ef84299dff1b58a52b6939b5277194003a054b383daa7da72
6
+ metadata.gz: 7e4a56cda71b8d97d780c0bdbc5df8338822e0f34772c962a0c067bd379e884d73367d5f153c606ca084b9edcec4a6d52057fe2091c113ae340ddc0c5f638e47
7
+ data.tar.gz: d3117be6c0a13e0abfa183c52095fe7f383109a7720e461d2af504c8d9471259903916c4f403d8fbd7ff4ecab4914e2fb558cccb733ff675d7560b2c86b67e5d
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.7.0
1
+ 1.8.0
@@ -10,7 +10,8 @@ module BootstrapEmail
10
10
  :sass_load_paths, # array of directories for loading sass imports
11
11
  :sass_cache_location, # path to tmp folder for sass cache
12
12
  :sass_log_enabled, # turn on or off sass log when caching new sass
13
- :generate_rails_text_part # boolean for whether or not to generate the text part in rails, default: true
13
+ :generate_rails_text_part, # boolean for whether or not to generate the text part in rails, default: true
14
+ :override_mail_method # method to override the mail method in rails, default: false
14
15
  ].freeze
15
16
 
16
17
  attr_accessor(*OPTIONS)
@@ -28,6 +29,7 @@ module BootstrapEmail
28
29
 
29
30
  def defaults
30
31
  self.generate_rails_text_part = true
32
+ self.override_mail_method = false
31
33
  end
32
34
  end
33
35
  end
@@ -2,8 +2,16 @@
2
2
 
3
3
  ActiveSupport.on_load(:action_mailer, { yield: true }) do |action_mailer|
4
4
  action_mailer.class_eval do # To support Rails less than 6
5
+ # Only override mail method if override_mail_method is enabled
6
+ if BootstrapEmail.static_config.override_mail_method
7
+ alias_method :rails_mail, :mail unless method_defined?(:rails_mail)
8
+ def mail(*args, &block)
9
+ bootstrap_mail(*args, &block)
10
+ end
11
+ end
12
+
5
13
  def bootstrap_mail(*args, &block)
6
- message = mail(*args, &block)
14
+ message = method_defined?(:rails_mail) ? rails_mail(*args, &block) : mail(*args, &block)
7
15
  BootstrapEmail::Rails::MailBuilder.perform(message)
8
16
  end
9
17
  alias_method :bootstrap_email, :bootstrap_mail
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap-email
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stuart Yamartino