Skip Navigation

[Resolved] How to email parent post author without sharing ID or email in URL param?

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.

Our next available supporter will start replying to tickets in about 0.91 hours from now. Thank you for your understanding.

This topic contains 2 replies, has 2 voices.

Last updated by himanshuS 1 month, 1 week ago.

Assigned support staff: Waqar.

Author
Posts
#2165007

I am building a job board where there is a parent post type called 'Jobs' and a child post type called 'Job Applications'.

The two posts are in an O2M relationship and I want to send a notification to the author of the job post type when a user submits a job application.

The CRED has an option of an email -- which I can populate via URL. This exposes the email address and I don't like that.
The other option is to share the User ID via a URL parameter and populate a generic field and use that field to send an email on form submit. But this also exposes the user id - which is not good.

How can I use CRED to send an email to the job post author when a child post is submitted without using URL param?

#2165345

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

To achieve this, you can use the "cred_notification_recipients" filter to modify the email recipients:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_notification_recipients

You'll find relevant code snippet examples in these threads:
https://toolset.com/forums/topic/email-notification-to-parent-post-author-when-child-form-is-submitted/
https://toolset.com/forums/topic/email-notification-to-parent-post-author-when-child-form-is-submitted-2/#post-1995977

regards,
Waqar

#2166187

My issue is resolved now. Thank you!