Configure letter opener
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
namespace :dev do
|
||||
desc "Toggle using Letter Opener to preview emails"
|
||||
task :email do
|
||||
file_path = Rails.root.join("tmp", "email-dev.txt")
|
||||
|
||||
if File.exist?(file_path)
|
||||
File.delete(file_path)
|
||||
puts "Letter Opener turned off"
|
||||
else
|
||||
FileUtils.touch(file_path)
|
||||
puts "Letter Opener turned on"
|
||||
end
|
||||
|
||||
%x(bin/rails restart)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user