ryanb / letter_opener

Preview mail in the browser instead of sending.
MIT License
3.72k stars 236 forks source link

Nothing happens #1

Closed patrickberkeley closed 12 years ago

patrickberkeley commented 13 years ago

I followed the instructions (1. Add the gem to Gemfile, run bundle, 2. Set delivery method to :letter_opener in development.rb) and nothing happens when a mail is sent. I scanned through the logs and it looks normal. Tried this with both pow and normal WEBrick server.

Thanks! This looks awesome.

gafrom commented 8 years ago

The same problem, FireFox, OS X EI Capitan, Rails 5. No tmp/letter-opener folder whatsoever. letter_opener v1.4.1 launchy v2.4.3

Any ideas what I may be missing? @mhassaan any luck with the issue?

mhassaan commented 8 years ago

@gafrom which version of ruby are you using ? My configuration is like this and luckily its working with this configuration. Ruby version: 2.1.2p95 Rails version: 4.1.1 In development.rb i have added this line config.action_mailer.delivery_method = :letter_opener

gafrom commented 8 years ago

@mhassaan I'm running on Ruby 2.3.1. Added all what I coould to development.rb: config.action_mailer.delivery_method = :letter_opener config.action_mailer.perform_deliveries = true and still no luck...

mhassaan commented 8 years ago

@gafrom I am quite sure you are missing something. I just tested this gem with following version ruby 2.2.1p85 Rails 4.2.1 And after bundle install, I added following two lines config.action_mailer.perform_deliveries = true config.action_mailer.delivery_method = :letter_opener

Restart the server And it worked fine. To be sure just check are you actually delivering emails or not . I mean may be you are forgetting to add 'deliver_now' when you try to send emails.

Like this, ModelMailer.welcome_email(model_instance).deliver_now

gafrom commented 8 years ago

Sorry for a delay,

@mhassaan yes, you're right, I used to enqueue mail jobs via deliver_later using Resque adapter which in turn failed to work properly for some reason. When I changed adapter to :inline mails started pouring up into browser smoothly 👍 .

Thanks.

mhassaan commented 8 years ago

@gafrom great to know that it works. You are welcome .

railsfactory-madhusudhan commented 7 years ago

I am also facing issue with letter_opener opening in browser on Ubuntu 14.04. App has tmp/letter_opener folder and files inside that. If I do Launchy.open("#{Rails.root}/tmp/letter_opener/1479795772_170cb89/rich.html") it is opening in browser, it is not triggering when it is called on deliver_now.

In development.rb config.action_mailer.delivery_method = :letter_opener config.action_mailer.perform_deliveries = true config.action_mailer.raise_delivery_errors = false

ruby - 2.3.1 rails - 4.2.5.1 letter_opener - 1.2.0

Ingosmar89219 commented 7 years ago

comunity please help me :(. 'letter_opener' works in ubuntu but in windows open a file with name "rich.html" in the editor sublime text but it should open in the browser, someone know why? thanks a lot

Mikopet commented 7 years ago

@Ingosmar89219 It's quite easy. It seems, to letter_opener opens the html outside the app. So if the default program to open html files is the editor, it opens with it.

acosonic commented 7 years ago

Yeah I can confirm also works for me on ubuntu, does not work for me on Windows nor OSX ...

Launchy works well though.

And I'm using old ruby though...

It seems to be related to application, the test application works, but Redmine does not...

Kadaaran commented 6 years ago

Same here. I followed exactly the README and there is no new tab opening when I send an email and the tmp files are not created. Any idea ? Ruby version: ruby 2.4.2 Rails version: 5.0.7

nashby commented 6 years ago

Can you please provide a sample application that reproduces the error?

berberecho5 commented 5 years ago

I had the same issue. I resolved it changing the ownership of letter_opener folder. It turns out that when I cloned the repo a root ownership was set to this and other tmp/ folders. Changing the ownership to your will fix the issue.

My tmp folder was:

drwxr-xr-x   7 cristiansaguer  staff   238  2 ago 12:21 .
drwxr-xr-x  43 cristiansaguer  staff  1462  2 jul 11:12 ..
drwxr-xr-x   3 root            staff   102 20 jun 17:55 cache
drwxr-xr-x   3 root            staff   102  2 ago 12:21 letter_opener
drwxr-xr-x   4 cristiansaguer  staff   136  2 ago 12:49 pids
drwxr-xr-x   2 root            staff    68 20 jun 17:55 sessions
drwxr-xr-x   2 root            staff    68 20 jun 17:55 sockets

Doing sudo chown cristiansaguer:staff letter_opener fix it.

szpasztor commented 4 years ago

I had the same issue. Making sure from and reply_to options were filled in fixed it.

default from: "test@test.com", reply_to: "test@test.com"
microspino commented 4 years ago

Just in case someone is still unable to see his/her email in the browser as per @mhassaan suggestion i solved by doing this:

_mailer = MyMailer.send_quote(@cart)
 Rails.env.production? ? _mailer.deliver_later : _mailer.deliver_now
computalya commented 3 years ago

the reason why it didn't work on my local machine was, that I had a space in my applications path.

~/workspace/demo applications/demoapp

it worked when I moved the demo app into /tmp

daveomcd commented 3 years ago

@computalya thanks! this was my problem too. I changed my projects parent directory from "Rails Projects" to "rails_projects" and then it worked. Previously, I was getting an error message in console saying...

The file /Users/david/Documents/Rails Projects/bmoretasty/file:/Users/david/Documents/Rails Projects/bmoretasty/tmp/letter_opener/1625881276_7074199_0cbffbc/rich.html does not exist.