Skip Navigation

[Resolved] change the notification to a specific email address

This thread is resolved. Here is a description of the problem and solution.

Problem:

A user asked if there is an option to change the email address recipient in the form notification when a specific option in the form field is selected.

Solution:

Guided that it is possible to change the recipient(s) of a form notification, using the "cred_notification_recipients" filter.

Relevant Documentation:

https://toolset.com/documentation/programmer-reference/cred-api/#cred_notification_recipients

This support ticket is created 2 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 3 replies, has 2 voices.

Last updated by garenM 2 years, 8 months ago.

Assisted by: Waqar.

Author
Posts
#2328567

Hey, I want to ask if there is an option to change the specific email address (toolset form) when is selected a specific option form the dropdown

#2328651

Hi,

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

Yes, it is possible to change the recipient(s) of a form notification, using the "cred_notification_recipients" filter:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_notification_recipients

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#2329247

Hey, I want to usee it if a select option from the form has a secific value. Is that possible? I used the below but didnt work.

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 ( $form_id == 3328 ) {
if ($fields['wpcf-subject-contact']['value']=='test'){

$recipients[] = array(
'to' => '',
'address' => 'm.i@actiondigitalagency.com',
'name' => '',
'lastname' => ''
);
}
}

return $recipients;
}

#2329251

My issue is resolved now. Thank you!