Skip Navigation

[Resolved] Adding “Reply To” form admin notifications

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

Problem:

The issue here is that the user wanted to customize their Toolset Forms notification headers.

Solution:

You can use the function below to modify the email notification headers.
https://toolset.com/documentation/programmer-reference/cred-api/#cred_mail_header

This support ticket is created 2 years, 10 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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 5 replies, has 2 voices.

Last updated by johnE-5 2 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#2096687

Hello,
I want to add "Reply To" my cred notification emails. I can do this with one notification form but cannot do it with more than one form. ( using this topic: https://toolset.com/forums/topic/emails-from-a-toolset-form-needs-to-reply-to-the-person-who-submitted-it/#post-1457297)

How do I add "Reply To" multiple notification forms?
T
Thanks
John

#2097167

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi John,

Thank you for getting in touch.

For clarity here is it that you are using the code from Waqar's ticket to modify the reply to header? However you want this to apply to multiple notifications ?

Please let me know.

Thanks,
Shane

#2097251

Hi Shane,
Yes, I want to be able to modify multiple notifications. I can only modify one using the code from Waqar's ticket.
Any help would be appreciated.
John

#2098039

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi John,

Thank you for the clarity.

You are actually able to extend the function to include more notifications. Have a look at the example below.


function customise_cred_notifications( $headers, $formid, $postid, $notification_name, $notification_number ) {
  if ($formid==1129 && $notification_name=='Send Inquiry') {
    $myheaders = array( 'Reply-To: '.$_REQUEST["email"] );
    return array_merge($headers, $myheaders);
  }
 if ($formid==1234 && $notification_name=='Next Notification') {
    $myheaders = array( 'Reply-To: '.$_REQUEST["email"] );
    return array_merge($headers, $myheaders);
  }
  return $headers;
}
add_filter('cred_mail_header', 'customise_cred_notifications', 10, 5);


Notice that i've added a second "if" statement that is only meant to run when its criteria is matched.

Please let me know if this provides some direction for you.

Thanks,
Shane

#2098067

That's great, Thanks Shane

#2098069

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.