N
Novu16mo ago
Saruchi

How to link SubscriberCreateData with Subscriberpreferences while triggering a notification event?

I am creating a Subscriber with SubscriberCreateData And adding preference for Email,slack,Inapp using SubscriberPreferenceEditData When i trigger a notification using Event.Trigger(EventCreateData) to the same subscriber..my preferences are not met SubscriberPreferenceEditData is not attached to the Subscriber Object
7 Replies
Pawan Jain
Pawan Jain16mo ago
@dr.really Could you please help here? Is this an issue with our .net sdk?
dr.really
dr.really16mo ago
@saruchi_13291_71869 what version of the .net sdk are you running? cc: @todd7201
todd
todd16mo ago
@saruchi_13291_71869 —you language suggests you have enough of the latest version. What does your test look like that tries to do this? I use the sdk in production code but do have tests against all these major functions. If you don't might I suggest looking at the Test project as it helps with setup and teardown—although you could also do this using the the Sync library. The test to base code on is in the Acceptance > NotificationTests. Personally, I wouldn't be surprised if this doesn't work. From experience, the trigger doesn't always work as I would expect with payloads (eg email) and I tend to need to look at the code once I have a scenario that doesn't work. I am happy to work with you to write a test that expresses your workflow and put it in the library. One place to start is to log a bug in the library but it would need to be more specific that you have expressed. ps. I suspect the key problem lies between the payload in a trigger (which CAN create subscribers (to some extent) but I don't think UPDATES) and the subscriber which has both create/update. Again a test will express this and can confirm behaviour looking at the code. A final point, other SDKs may have expressed this problem and may be work hunting down.
Saruchi
SaruchiOP16mo ago
Thanks for the reply Later I figured out that if I set the setting in screenshot to on (User preference takes precedence over Workflow ) then it works.. This particular switch is worth mentioning in the document 🙂
No description
Pawan Jain
Pawan Jain16mo ago
Hi @Saruchi We have this info in docs https://docs.novu.co/subscribers/preferences#exclude-workflows-from-preferences-critical-workflow @unicodeveloper I think we should add this info on workflow section as well
Prosper
Prosper16mo ago
Yeah that makes sense, so people won’t miss it. Will do
Want results from more Discord servers?
Add your server