Skip Navigation

[Resolved] Error in documentation about cred notification numbers

This support ticket is created 7 years, 3 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
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

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

This topic contains 2 replies, has 2 voices.

Last updated by romanB-3 7 years, 3 months ago.

Assisted by: Noman.

Author
Posts
#560276

Hello,

In the documentation of cred mail header function https://toolset.com/documentation/programmer-reference/cred-api/#cred_mail_header I think there is an error :

In arguments I read num_notification. An ID of a notification of the form we are targeting. As you add notifications to a CRED form, each notification has a $num_notification associated with it, starting from zero (0). This means that first notification in a form has a $num_notification value of 0, second one has a value of 1, and so on.

But in the example I read

//Customise CRED notifications
function customise_cred_notifications( $headers, $formid, $postid, $notification_name, $notification_number ) {
    if ($formid==5 && $notification_number==0) {
        $myheaders = array( 'Reply-To: noreply@test.it' );
        return array_merge($headers, $myheaders);
    }
    return $headers;
}

Where the notification number is called "$notification_number"...

Which one is the correct argument ?

Thank you.

#560377

Noman
Supporter

Languages: English (English )

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

Hi Roman,

Both would work fine since those are variable names, the builtin arguments are:

 $headers, $formid, $postid, $notname, $notnum 

Our team member said the filter in CRED is like:

apply_filters('cred_mail_header', $header, $this->_formid, $this->_postid, $this->_notname, $this->_notnum);

So you can use either num_notification OR notification_number OR notnum
Thanks

#560407

Thank you.
I was a bit confused.