Skip to content

Commit

Permalink
Merge pull request #73 from nashby/delivery-method-improvement
Browse files Browse the repository at this point in the history
Disable Launchy using ENV variable instead of completely redefining `deliver!` method.
  • Loading branch information
pseudomuto authored Jan 14, 2018
2 parents 47b693c + 2c7b1f4 commit a5352b6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/letter_opener_web/delivery_method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
module LetterOpenerWeb
class DeliveryMethod < LetterOpener::DeliveryMethod
def deliver!(mail)
location = File.join(settings[:location], "#{Time.now.to_i}_#{Digest::SHA1.hexdigest(mail.encoded)[0..6]}")
LetterOpener::Message.rendered_messages(location, mail)
ENV['LAUNCHY_DRY_RUN'] = 'true'
super
ENV['LAUNCHY_DRY_RUN'] = 'false'
end
end
end

0 comments on commit a5352b6

Please sign in to comment.