Hi Ian
I did some thorough testing on a clean site, which led me to find and review some existing internal tickets relating to notifications and fields from related posts.
Firstly, something that confused me was that the placeholders for the title and link to the parent post don't work, but it turns out that's known and expected: https://toolset.com/errata/post_parent_title-placeholder-doesnt-work-in-cred-notification-emails/
It's still possible to choose them in the UI for legacy reasons, but they don't work.
The correct way to include fields from related posts (e.g. parents) is to use the item attribute to specify a different source for the shortcodes than the current post.
Now the problem.
At the time the form is submitted the current post context is correct, it's the post that was just created by the form.
But for other, deferred, notifications (e.g. when the post status changes), the context is lost, and you need to force it by adding the attribute item="%%POST_ID%%" to the shortcodes.
That's fine when you are outputting fields from that post. But you can't add the item attribute twice, once to set the current post context, and again to set the related post.
So the long and the short of it is that you cannot reference fields from related posts in deferred notifications.
(In principle it would be possible, just not with the current implementation in Forms. We have internal tickets about improving this, but it is a question of priorities.)
Now, if you really need this to work, you will need to come up with your own solution.
Shortcodes in the notifications will be parsed (not just Toolset ones).
So you could register a custom shortcode where you pass the post ID via an attribute using %%POST_ID%% to set the starting context, and from there, within your shortcode, you can use toolset_get_related_post to retrieve the parent post, and then return a string including whatever field is needed. (You could make several specific shortcodes, or you could make a more generic one and pass the relationship slug and the field slug as shortcode attributes, too.)
This simple example demonstrates that you can access the ID of the post created with the form, even in deferred notifications:
add_shortcode('related', function ($atts = []) {
// provide defaults
$atts = shortcode_atts(
array(
'id' => null,
),
$atts
);
$output = "";
if (isset($atts['id'])) {
// logic goes here to get fields from related post
// here I'm just returning the ID of the current post itself
$output = $atts['id'];
}
return $output;
});
where you would add the following to the notification body:
[related id="%%POST_ID%%"]
See https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_get_related_post for getting the ID of the parent post