Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable Launchy using ENV variable instead of completely redefining deliver! method. #73

Merged
merged 1 commit into from
Jan 14, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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