ankane / ahoy_email

First-party email analytics for Rails
MIT License
1.11k stars 137 forks source link

How to store or replay the message body? #136

Closed fwolfst closed 5 years ago

fwolfst commented 5 years ago

Great stuff. What is the easiest way to replay (or better: store the actual) body of mails that were sent? If you give a rough outline, I'll figure out the details and gladly submit a PR for the README.

ankane commented 5 years ago

Hey @fwolfst, if you have a content field on your model, the full message will be stored. If you want to customize it further, you can use the track_method option that's documented in the readme.

fwolfst commented 5 years ago

Okay, inspected the source. The model should be on Ahoy::Message and can be added by a migration, e.g. add_column :ahoy_messages, :content, :text . That seems to work and apparently was default once (?). Should I mention that with the exemplary migration and a "warning" (because mails usually contain protectable stuff) in a PR for the README?

fwolfst commented 4 years ago

@ankane I stumbled upon this again and would like to contribute a README improvement, any opinion?