kortirso / emailbutler

Simple email tracker for Ruby on Rails applications. Emailbutler allows you to track sending params and delivery status of emails, resend them if required.
MIT License
20 stars 3 forks source link

If an attachment is saved with non-utf8 parameters a JSON::GeneratorError is thrown #9

Closed zachfeldman closed 10 months ago

zachfeldman commented 10 months ago

I get a JSON::GeneratorError: Invalid Unicode [9c 3d 8e cb 0a] at 72 with one of our emails that saves a PDF.

I think we need to prevent any string that doesn't return valid_encoding? from being saved. There's probably not too much value in saving files like this to the record. In our case, we generate it anyway when we send the email and it can be easily re-generated. I'll spin up a PR with this suggested change.