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.
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
Thank you.
I was a bit confused.