OneSignal-WordPress-Plugin icon indicating copy to clipboard operation
OneSignal-WordPress-Plugin copied to clipboard

Uncheck "send notification on post publish" after post published and send_os_notif not called in notice.js

Open jfishman1 opened this issue 5 years ago • 1 comments

Description:

In the settings you can turn on or off the ability to "Automatically send a push notification when I create a post from the WordPress editor"

Screen Shot 2020-10-28 at 5 08 59 PM

If this is off, like in the image. When you go to publish a post, the checkbox to send the push is unchecked. You need to check it to send. - Correct behavior.

But when you check the box to send the push upon post publish the send_os_notif variable within notice.js is never triggered:

// is checked const send_os_notif = jQuery("[name=send_onesignal_notification]").attr( "checked" );

Therefore this code does not trigger:

// if hasn't started, change detected, box checked, and the status is 'publish' // this does not get called if the checkbox option is unchecked in the settings if (!state.started && post_modified && send_os_notif && is_published ) { console.log("here") state.interval = setInterval(get_metadata, 3000); // starts requests state.started = true; }

This was brought up when customer was trying to uncheck the "Send notification" checkbox after the post is published and still within the same post session.

jfishman1 avatar Oct 29 '20 00:10 jfishman1

To summarize, the problem is not that the notification doesn't send, but rather that the notification delivery data is not displayed in Gutenberg if the automatic send toggle isn't on.

rgomezp avatar May 25 '22 20:05 rgomezp