Add/hydrate subscriber email in a custom step
This section of the docs mentions
You can also pass only the subscriberId during a request, and hydrate the data directly from your database or other sources during the trigger execution. This is useful when you don’t want to store all the subscriber data in Novu.I'd like to do this, specifically to pass only my subscriber id in the payload and get the email from my db in the workflow itself. I'm not sure how to do so, anyone knows?
4 Replies
@Alex DB
This is useful when you don’t want to store all the subscriber data in Novu.We need to update this line in docs. Currently only metadata like firstname, and lastname can be fetched just in time. But email, phone, and locale must be to stored for a subscriber and should have valid value
Thanks!
Hi @Alex DB thanks for raising this!
We revised our documentation in the linked Subscribers Concepts section to make a clear distinction between Subscriber delivery data and Subscriber metadata resolution. We hope that clears up the confusion, any further feedback will be appreciated 🙏
Hi @Richard Fontein ! I think it's a lot clearer now.
I think specifically the word
hydrate
should not be used here, it makes me think I would do something like subscriber.firstName = "Alex"
whereas what you're talking about is "just" the fact that your template data can come from different sources.
Maybe wording it like "If you don't want non-required subscriber data to be stored by Novu, you can pass only the required keys in the to
section and fetch the rest of the data in the step as you would anything else. -> show the same example"
Does that make sense?