the email service expects symbols as option keys
did
committed Mar 30, 2016
commit ecfb89754d545369beb1c36b70f7b3e23624faad
Showing 2
changed files with
5 additions
and 5 deletions
locomotive/steam/services/action_service.rb b/lib/locomotive/steam/services/action_service.rb
+2
-2
| @@ | @@ -51,11 +51,11 @@ module Locomotive |
| end | |
| def send_email_lambda(liquid_context) | |
| - | -> (options) { email.send_email(options, liquid_context) } |
| + | -> (options) { email.send_email(options.with_indifferent_access, liquid_context) } |
| end | |
| def get_prop_lambda(liquid_context) | |
| - | -> (name) { liquid_context[name].as_json.tap { |e| puts e.inspect } } |
| + | -> (name) { liquid_context[name].as_json } |
| end | |
| def set_prop_lambda(liquid_context) | |
locomotive/steam/services/email_service.rb b/lib/locomotive/steam/services/email_service.rb
+3
-3
| @@ | @@ -15,7 +15,7 @@ module Locomotive |
| options[:via] ||= :smtp | |
| options[:via_options] ||= options.delete(:smtp) | |
| - | log(options) |
| + | log(options, simulation) |
| !simulation ? Pony.mail(options) : nil | |
| end | |
| @@ | @@ -75,8 +75,8 @@ module Locomotive |
| end | |
| end | |
| - | def log(options) |
| - | message = ["Sent email via #{options[:via]} (#{options[:via_options].inspect}):"] |
| + | def log(options, simulation) |
| + | message = ["[#{simulation ? 'Test' : 'Live'}] Sent email via #{options[:via]} (#{options[:via_options].inspect}):"] |
| message << "From: #{options[:from]}" | |
| message << "To: #{options[:to]}" | |
| message << "Subject: #{options[:subject]}" | |