Skip Navigation

[Resolved] How to show grandparent post custom field in email on child post submission?

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 2 replies, has 2 voices.

Last updated by himanshuS 1 month, 3 weeks ago.

Assigned support staff: Jamal.

Author
Posts
#2153431

I have three post types ---
1) Company
2) Jobs
3) Job Applications

I want to send an email to the user on application submission using CRED. I am able to include information about the parent post using the relationship item attribute but I am not sure how to show grandparent field (Company Name).

Is there a way to do this in CRED form using the fields and views, and placeholders features?

#2153807

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello and thank you for contacting Toolset support.

Well, you can create a custom placeholder that will return the grandparent data. Use the toolset_get_related_post function twice to get the grandparent.
- https://toolset.com/documentation/programmer-reference/forms/how-to-use-custom-placeholders-in-cred-notifications/
- https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_get_related_post

Without custom coding, you will need to use content templates and pass the item attribute to it(Job). And inside of the content template, you will display the parent(Company) post name. Does it make sense?

#2154933

My issue is resolved now. Thank you!