Hello ActivityPub team
In my functions php I have a function that when a post is set to Pending, a mail is triggered to go to Admin wp_mail( $dest, "New post pending review: {$title}", $body );
And there’s a few calls to this function like this
add_action('future_to_pending', 'send_emails_on_new_event');add_action('new_to_pending', 'send_emails_on_new_event');
add_action('draft_to_pending', 'send_emails_on_new_event');
add_action('auto-draft_to_pending', 'send_emails_on_new_event');
add_action('publish_to_pending', 'send_emails_on_new_event');
After upgrading to 5.1.0 (from 4.7.3) we experienced the following behaviors:
- got a few hundred Pending mails as it went back all the way to 2022
- the URL for the post is <siteurl>?post_type=ap_outbox&p=65778 (in m mail function, I build the body like this
$url = get_permalink($post->ID);
$body = “Link to post pending review: n{$url}”;
However, the subject of the mail doesn’t contain that ?post_type=ap_outbox. The subject is built using this
$title = wp_strip_all_tags(get_the_title($post->ID)); - After that, everytime I post a new post on my webpage, I get two new mails like this:
First email: Subject: new post pending review and ‘normal’ url but body adds the ?post_type=ap_outbox
Second email: Subject: new post pending review and url which gets this string concatnated to it activity-create-2025-02-16T08:14:30Z And mail body with the post_type=outbox - Today, 16th of February, I have upgraded to the latest version 5.2.0 and I notice a new behavior in the mails after the upgrade
The two mails I started getting now have different subjects:
New post pending review: [Create] Note: – <post title>
New post pending review: [Announce] Create: – <post title> - If I disable the Activity Pub plugin, none of this happens and I only get notified by email when one of my colleagues places a post in Pending status
Could I please get some help understanding what I can change to prevent this from happening while running the activity pub plugin?
Thank you
Andrea


Leave a Reply