garretB
Support threads created in the last 30 days: 0
Favorite Forum Topics
This user has no favorite topics.
Forum Topics Created
Status | Topic | Supporter | Voices | Posts | Freshness |
---|---|---|---|---|---|
Sending email to the grandparent post email field
Started by: garretB
in: Toolset Professional Support
Problem: 1) I am using below post type structures 2) Use CRED form to create the child "Property Inquiries" post, and I want to send mail to the "Agents" email address "agent-email-address". Solution: You can use CRED filter hook "cred_notification_recipients" to send the mail, for example, add PHP codes in your theme/functions.php: add_filter('cred_notification_recipients', 'my_cred_notification_recipients_func', 10, 4); function my_cred_notification_recipients_func($recipients, $notification, $form_id, $post_id){ if (2215 == $form_id){ $agent_slug = "agents"; $property_slug = "properties"; $email_field_slug = "agent-email-address"; $property_id_slug = '_wpcf_belongs_' . $property_slug . '_id'; $agent_id_slug = '_wpcf_belongs_' . $agent_slug . '_id'; $property_id = get_post_meta($post_id, $property_id_slug, true); $agent_id = get_post_meta($property_id, $agent_id_slug, true); $post_email = get_post_meta($agent_id, 'wpcf-' . $email_field_slug, true); $recipients[] = array('to'=>'to', 'name'=>'', 'lastname'=>'', 'address'=>$post_email ); } return $recipients; } Relevant Documentation: https://toolset.com/documentation/programmer-reference/cred-api/#cred_notification_recipients |
2 | 8 | 6 years, 8 months ago | ||
Cannot Display Grandparent Information on Grandchild Template
Started by: garretB in: Toolset Professional Support |
3 | 12 | 7 years, 3 months ago |