bootstrap-email 1.7.0 → 1.8.1

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: fe52b04e27f9f7e347eb90042033cad29b2095a737b8e08f444a42f4afabc0d7
4
+ data.tar.gz: 8386cb5e25c04d7106a5a1a3f81d1ed43cb77d4ccce6d2b84d0c2d6f40c0527d
5
5
  SHA512:
6
- metadata.gz: e9561a847b402c882897680695d56bd4d226ec40e331d29df3d49ced0405964372304ee631646a4e70af1d216cdde01f674f742dcb906e0eae59909362d635c6
7
- data.tar.gz: 25ee5b14236ea8d58228a5bfc95b0d2b4bbc2c75e63daab5b818414bc0d02c336a5ca49718adbf3ef84299dff1b58a52b6939b5277194003a054b383daa7da72
6
+ metadata.gz: e269f13af8280a7b07bf95a429ef0aff6fcf8bdfb4ea58e91c8cd95db0644da585f34fe75254f61ecc5b35d92e2a295a9a0e90db1a733e9418439fb8d2d1af6e
7
+ data.tar.gz: 6277a8b81b14c259701bd6ed406c76fda715b3af62e98e57ab4dc2fefac0c4756e81fe4d29ee32bdd9de769e9fd56af3c2cccddf617cc3a517aa2a86099e2d8d
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.7.0
1
+ 1.8.1
@@ -3,14 +3,15 @@
3
3
  module BootstrapEmail
4
4
  class ConfigStore
5
5
  OPTIONS = [
6
- :sass_email_location, # path to main sass file
7
- :sass_head_location, # path to head sass file
8
- :sass_email_string, # main sass file passed in as a string
9
- :sass_head_string, # head sass file passed in as a string
10
- :sass_load_paths, # array of directories for loading sass imports
11
- :sass_cache_location, # path to tmp folder for sass cache
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
6
+ :sass_email_location, # path to main sass file
7
+ :sass_head_location, # path to head sass file
8
+ :sass_email_string, # main sass file passed in as a string
9
+ :sass_head_string, # head sass file passed in as a string
10
+ :sass_load_paths, # array of directories for loading sass imports
11
+ :sass_cache_location, # path to tmp folder for sass cache
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
14
+ :override_mail_method # boolean 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 = respond_to?(: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
@@ -11,8 +11,10 @@ require 'fileutils'
11
11
  require 'htmlbeautifier'
12
12
 
13
13
  begin
14
+ require 'logger' # Required for Rails 6.1+ compatibility with Ruby 3.4+
14
15
  require 'rails'
15
- rescue LoadError; end
16
+ rescue LoadError
17
+ end
16
18
 
17
19
  require 'action_mailer' if defined?(Rails)
18
20
 
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.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stuart Yamartino