Oh no, not all this is happening in the one customised plugin. I was simply describing what appears to be happening in the system as a whole when you hit the Submit button in the customised post. This thing is one tortured mass of plugins. 🙁
The Custom post page is generated by Gravity Forms. This is the plugin that handles creating a post & saving it.
The Add-a-Post-to-Activity-Stream-so-it-sends-an-Email-Like-an-Update is provided by a custom plugin that extends the functionality of BuddyPress Group Email Subscription.
It just seems that the timing’s out a bit.
If I can make the postmeta handling occur before the post is added to the Activity Stream, then all will be well, as my own trivial addition to this will be fine.
I’ll take a look at wp_mail. I thought that Buddypress may override what happens in there.
Thanks for that & apologies for posting in the wrong part of the forum. Just noticed that.
We have a similar problem on a website that has blog posts & we would like the blog posts added to the group activity feed, so people can receive an email digest, but we are at a loss as to when to call the function etc.
Can you recall how/where to declare this function? Any advice appreciated.