The notification gets sent and then it gets stuck after the function ends. nothing comes up in the debugger to say there's an error or anything either.
I was wondering if it was anything to do with not returning anything, but i can't see why that would be an issue.
I'll have to keep trying and see if i cant get anything to pop up.
Do you by chance know how it'd be possible for me to retrieve the articles URL at all, while still knowing that it's the first publish?
The Url isn't in the published event. I read that it doesn't exist until the cache is written, which is after all the possible event hooks.
Also, the Published event doesn't have any indication whether its a new item or not, as by this point it's already published and has an id and published state.
edit:
this is where i read about when the URL is created
content service event intercepting
Hey. I'm trying to send out web notifications whenever a new article is published for the frist time.
I've got it for the most part. The notifications are sending, but there's a few things im missing that i can't work out.
Basically it just loops through a table in the database and sends out notifications to each endpoint.
At the moment this is just a proof of concept. Any ideas for better implementations would be considered :)
Hi!
Have you tried to debug the code and step trough it? I'm thinking that this might give you some clues to why the code hangs.
About your SQL-code you could use the PetaPoco-implementation in Umbraco to avid hardcoding the database-stuff:
https://nddt-webdevelopment.de/umbraco/create-custom-database-table-umbraco-petapoco
(Not at all necessary but could be fun =D)
I have tried stepping through it.
The notification gets sent and then it gets stuck after the function ends. nothing comes up in the debugger to say there's an error or anything either.
I was wondering if it was anything to do with not returning anything, but i can't see why that would be an issue.
I'll have to keep trying and see if i cant get anything to pop up.
Do you by chance know how it'd be possible for me to retrieve the articles URL at all, while still knowing that it's the first publish?
Hi!
I guess that you would need to hook into the Published-event to get the URL - not sure.
But you would find the URL using entity.Url
// m
The Url isn't in the published event. I read that it doesn't exist until the cache is written, which is after all the possible event hooks.
Also, the Published event doesn't have any indication whether its a new item or not, as by this point it's already published and has an id and published state.
edit:
this is where i read about when the URL is created
https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/47922-Problem-With-V702-Events#comment-171543
is working on a reply...