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

sparkpost_datais not persisted when mail is deserialized #59

Open
silvabox opened this issue Dec 21, 2018 · 0 comments
Open

sparkpost_datais not persisted when mail is deserialized #59

silvabox opened this issue Dec 21, 2018 · 0 comments

Comments

@silvabox
Copy link

We are using sparkpost_rails with DelayedJob. DelayedJob serializes the mail object to a database table using YAML, for later execution. When the job is deserialized from YAML, its enclosed Mail::Message instance is also deserialized, however the sparkpost_data method is undefined. Since this method is defined inside of the mail method in DataOptions::InstanceMethods, any Mail::Message instance created outside of this method (e.g. through deserialization) will not have the method present. This means all of our emails fail to send, with (e.g.) #<NoMethodError: undefined method sparkpost_data' for #Mail::Message:0x00007f90cdcc22d8>`.

I'll fork the code and experiment with some possible fixes, but if there's an obvious/ preferred approach, please do let me know and I'll pursue it.

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

No branches or pull requests

1 participant