-
Notifications
You must be signed in to change notification settings - Fork 114
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
Heroku - worker support #35
Comments
Yeah, sorry that you had trouble with that :-( The only scenario where letter_opener_web works fine on Heroku is when you have a single dyno with no mails being sent on the background. I'm just not sure about keeping mails on S3, maybe Redis would be an easier approach? I initially thought of keeping things on the app's DB, but that will end up polluting our I don't have a strong need for getting this gem to work on Heroku apart from the demo app, so it is something I might not work on for a while. |
Completely fine and understandable. If i'd have a bit more of time i'd build this feature because your gem kicks ass. Imho just add a note in the Readme - maybe just link to this issue - just to save the next person some time |
Happened to me too. |
Notice added to the README on 79b2427 |
I'm not familiar with how Heroku is set up, but at Engine Yard, as part of the deploy process, you are able to use deploy hooks. In the deploy hooks, you can symlink to shared resources and directories, so I have it set up so that before the app restarts, I do this:
and then everything works great, no matter how many instances I have running... |
The resolution for now seems to be the notice in the README. Since this is a few years old, I'm going to close it. If this is still a concern, re-open. |
what if there was an option to store emails in redis? |
That or storing it on a DB would also work |
Still a concern for me. Could use this for Heroku when sending mails with deliver_later. However, if I'm the only one, it might not be worth the trouble :p Any suggestions on how to test (mass) mails in staging environments on Heroku without sending them to real people? |
There's a Heroku add-on that does this, there may be others: https://elements.heroku.com/addons/mailtrap |
If anyone has troubles with using this gem on Heroku with multiple workers, I solved this issue with this PR: #129 If the PR is not merged, you can use the updated version the following way:
|
A brilliant solution for AWS S3 users. However, it's still not a universal solution for those who run Rails server and background servers (such as Sidekiq) separately. |
We could persist the letters in a database table. This would be an interesting approach nowadays. I'll open a issue on letter_opener itself to see if it could be interesting |
Hi guys
It seems letter_opener_web won't be much of use on heroku. I would assume that most people use workers to send their emails.
As far as i understand this workers and all dynos have isolated environments. Thus it can't really reach the same
/tmp
directory.Thinking about it makes as a lot of sense.
A workaround would be s3 support i guess. Unfortunately i personally can't implement that right now. But i think it would be worth the note in the README that it only works on heroku under certain conditions. Simply to save the time of the next person ;)
best wishes
Andreas
The text was updated successfully, but these errors were encountered: