Problem: I would like to use a Form to delete a User. When the Form is submitted successfully, I would like to send an email to that User's address.
Solution: Add a generic hidden field to the Form and call it something like "generic-email-field". Set the value to be the current User's email, like this:
[cred_generic_field type='hidden' field='generic-email-field'] { "required":0, "validate_format":0, "default":"[wpv-user field='user_email']" } [/cred_generic_field]
Then in the notification settings, I would choose "Send notification to a specific email address" and enter something like support@yoursite.com, where all these messages will be sent. Then you can use the cred_notification_recipients API to add the generic field address as a CC, like this:
add_filter('cred_notification_recipients', 'modify_recipients', 10, 4); function modify_recipients($recipients, $notification, $form_id, $post_id) { // Check notification name matches target notification if ( isset($notification['name']) && 'Your notification name' == $notification['name'] ) { // Add a CC to the generic email address $recipients[] = array( 'to' => 'cc', 'address' => $_POST['generic-email-field'], 'name' => '', 'lastname' => '' ); } return $recipients; }
Change Your notification name to match your notification name.
Relevant Documentation:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_notification_recipients
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.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
This topic contains 2 replies, has 2 voices.
Last updated by 5 years, 9 months ago.
Assisted by: Christian Cox.