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 +4 -4
- data/VERSION +1 -1
- data/lib/bootstrap-email/config_store.rb +3 -1
- data/lib/bootstrap-email/rails/action_mailer.rb +9 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5dac3404a2b0e1ea4f18290c2275e22dff41c9f04299b02098c9ad7d6558ea93
|
|
4
|
+
data.tar.gz: 49d3d4a4061fd8c9420cd662340c33b7fc3384b03d497c071c63f99ce56d5dbe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7e4a56cda71b8d97d780c0bdbc5df8338822e0f34772c962a0c067bd379e884d73367d5f153c606ca084b9edcec4a6d52057fe2091c113ae340ddc0c5f638e47
|
|
7
|
+
data.tar.gz: d3117be6c0a13e0abfa183c52095fe7f383109a7720e461d2af504c8d9471259903916c4f403d8fbd7ff4ecab4914e2fb558cccb733ff675d7560b2c86b67e5d
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.
|
|
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
|