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

Exposing Letter Opener File Save Path #207

Merged
merged 1 commit into from Feb 10, 2024

Conversation

jonmchan
Copy link
Contributor

I was interested in knowing where the generated message was being located so that I can open it up in another application. This PR simply exposes the generated message path in the original Mail::Message object. Thought someone else might find this useful.

It exposes the rich and the plain version at:

mail['location-rich'].value
=> "/app/tmp/letter_opener/1700503091_0311892_1d5f48e/rich.html"
mail['location-plain'].value
=> "/app/tmp/letter_opener/1700503091_0311892_1d5f48e/plain.html"

This object is returned from mailers such as ActiveMailer after the mail is sent.

@nashby nashby merged commit 1b9611f into ryanb:master Feb 10, 2024
@nashby
Copy link
Collaborator

nashby commented Feb 10, 2024

@jonmchan sorry it took that long to merge but I find it useful indeed! Thank you.

@jonmchan jonmchan deleted the record-filepath branch February 10, 2024 21:59
@jonmchan jonmchan restored the record-filepath branch February 10, 2024 21:59
@jonmchan
Copy link
Contributor Author

jonmchan commented Feb 10, 2024

Thanks for merging @nashby ! If we can get a release, that would be awesome so I don't have to point to my custom branch in my Gemfile. Thanks!

@nashby
Copy link
Collaborator

nashby commented Feb 13, 2024

@jonmchan hey! 1.9.0 has been released, please give it a try!

@jonmchan jonmchan deleted the record-filepath branch February 23, 2024 02:40
@jonmchan
Copy link
Contributor Author

jonmchan commented Mar 4, 2024

@nashby thanks so much - updated the gems and everything still works as expected!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants