Closed detain closed 1 month ago
From the top of my head I think that envelope turns into delivery at some point, hence the "later also from the delivery object". So that example would indeed be incorrect, it would need to access delivery.my_custom_value instead I think.
Then again the queue:release
hook gets neither envelope nor delivery. Not sure what's in the data argument though, you could check what's in there!
It is as you said the envelope data became delivery so its available in many of the hooks but not the queue:release I wound up just using redis to store the data i want between hooks.
According to the Plugins section: If you add your own properties to the envelope object or modify existing ones then these are persisted and available in other hooks and later also from the delivery object. Only use values that can be serialized into JSON for custom properties.
However this does not seem to be the case. Testing with the queue:release I tried to access envelope but it gave a plugin error due to envelope not being set. In the example the sender:fetch does not pass envelope either but it appears (from the docs) as if its still available to it. I think the docs might be wrong and that its only available to hooks that pass envelope. I would like to be able to pass a simple string from the sender:headers hook to the queue:release hook using this method or another. Is this possible?