• I’m running AutomatorWP on a multisite network – it’s only activated on our main site. We’re using it to trigger an email when a new post is created.

    However, we also use the Broadcast plugin to send posts from other sites in our install to the main website.

    The issue I’m having is that any post that comes into our main site via Broadcast doesn’t trigger the email. Broadcast copies the content to the post table of each site you send it to.

    I spoke with the developer of Broadcast, and he thought there may be a way to add compatibility. He shared the following info on how the plugin works:

    Just before Broadcast is finished creating / updating the post on the child site, the following action is called.

    threewp_broadcast_broadcasting_before_restore_current_blog( $action )

    The ID of the post that has been created or updated is found here:

    $action->broadcasting_data->new_post( 'ID' )`

    Do you have any advice for making these plugins work together?

    Thanks for your time!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Ruben Garcia

    (@rubengc)

    Hi @karks88

    I would be more than happy to assist you today

    AutomatorWP triggers works based on the events that WordPress or plugins launches internally

    At the moment a post is created, WordPress launches several events to let other plugins know that those posts have been updated and those are the events that AutomatorWP uses to launch the trigger

    If the team of that plugin includes the WordPress default events, then AutomatorWP (and any other plugin that works based on the WordPress events) will be able to detect this plugin posts

    If not, you may need to add custom code to your site that “listens” the Broadcast event and then triggers the event that AutomatorWP is listening for the triggers

    In our case we are listening for the event:
    do_action( 'transition_post_status', $new_status, $old_status, $post );

    Hope it helps!

    Thread Starter Eric Karkovack

    (@karks88)

    Thank you @rubengc!

    Plugin Author Ruben Garcia

    (@rubengc)

    You’re welcome @karks88 😉

    Author of Broadcast here!

    We tried that do_action call but that didn’t help.

    My guess is: Automator loads its various automations when the plugin itself is loaded. When Broadcast does its broadcasting, it switches blogs and then either wp_insert_post or wp_update_post on the child blog.

    This triggers the transition_post_status action, Automator checks its loaded automations, sees nothing (since the source blog has no automations) and then does nothing.

    My guess is, if there were a way to force Automatator to reload its automations from the current blog, the wp_insert_post or wp_update_post call would trigger the automations on the switched blog.

    Is there a way to force Automator to reload its automations?

    Plugin Author Ruben Garcia

    (@rubengc)

    Hi @edward_plainview

    AutomatorWP just loads the triggers in the site/subsite that is actually loaded for performance

    But is possible to connect different subsites together with our Webhooks add-on:
    https://automatorwp.com/add-ons/webhooks/

    With our webhooks add-on you can send and receive data between sites, subsites and external platform

    Example of what you need:

    Subsite A:
    User creates a post > Send data to subsite B with the post information

    subsite B:
    On receive data > Create a post

    Hope it helps!

    There’s no chance of giving me a hint as to how to reload the automations when the blog is switched?

    Plugin Author Ruben Garcia

    (@rubengc)

    Hi @edward_plainview

    There is not a function that “reloads” the automations because in a subsite these automations does no exists

    When you switch a blog, you change the database you are using, for that in the current blog AutomatorWP does not finds the automations, because they are in a different database

    The unique way possible will be to switch again to the other site, force to reload everything, but again you will face that the post information is stored in a different site (which means a different database)

    The most easy solution that will not involve custom development (which is more expensive) is the one I recommended using our Webhooks add-on since this add-on lets you pass the information between sites without need to make all the described above

    Hope it helps!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Working with the Broadcast Plugin’ is closed to new replies.