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 +4 -4
- data/VERSION +1 -1
- data/lib/bootstrap-email/config_store.rb +10 -8
- data/lib/bootstrap-email/rails/action_mailer.rb +9 -1
- data/lib/bootstrap-email.rb +3 -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: fe52b04e27f9f7e347eb90042033cad29b2095a737b8e08f444a42f4afabc0d7
|
|
4
|
+
data.tar.gz: 8386cb5e25c04d7106a5a1a3f81d1ed43cb77d4ccce6d2b84d0c2d6f40c0527d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e269f13af8280a7b07bf95a429ef0aff6fcf8bdfb4ea58e91c8cd95db0644da585f34fe75254f61ecc5b35d92e2a295a9a0e90db1a733e9418439fb8d2d1af6e
|
|
7
|
+
data.tar.gz: 6277a8b81b14c259701bd6ed406c76fda715b3af62e98e57ab4dc2fefac0c4756e81fe4d29ee32bdd9de769e9fd56af3c2cccddf617cc3a517aa2a86099e2d8d
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.
|
|
1
|
+
1.8.1
|
|
@@ -3,14 +3,15 @@
|
|
|
3
3
|
module BootstrapEmail
|
|
4
4
|
class ConfigStore
|
|
5
5
|
OPTIONS = [
|
|
6
|
-
:sass_email_location,
|
|
7
|
-
:sass_head_location,
|
|
8
|
-
:sass_email_string,
|
|
9
|
-
:sass_head_string,
|
|
10
|
-
:sass_load_paths,
|
|
11
|
-
:sass_cache_location,
|
|
12
|
-
:sass_log_enabled,
|
|
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
|
data/lib/bootstrap-email.rb
CHANGED
|
@@ -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
|
|
16
|
+
rescue LoadError
|
|
17
|
+
end
|
|
16
18
|
|
|
17
19
|
require 'action_mailer' if defined?(Rails)
|
|
18
20
|
|