Skip Navigation

[Gelöst] How to replace to field in cred notification

This support ticket is created vor 7 Jahre, 1 Monat. 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.

Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

Dieses Thema enthält 1 Antwort, hat 2 Stimmen.

Zuletzt aktualisiert von Minesh vor 7 Jahre, 1 Monat.

Assistiert von: Minesh.

Author
Artikel
#524933

I am trying to:

send notification to dynamic email address with customer phone from the form. In example to 07905487@sms.clicksend.com. The number 07905487 (phone)must be taken from field (cust-phone) in the form submitted.

I visited this URL:

I've added this to functions

function customise_cred_notifications( $post_id, $headers, $formid, $postid, $notification_name, $notification_number ) {
if ($formid==2867 && $notification_number==2) {
$myheaders = array();
$myuser = get_post_meta($post_id, 'cust-phone', true);
$myheaders = array( 'CC: ' .$myuser. '@sms.clicksend.com' );
return array_merge($headers, $myheaders);
}
}
add_filter('cred_mail_header', 'customise_cred_notifications', 10, 5);

I expected to see:

value from cust-phone added to CC of the email.

Instead, I got:

Nothing - not even CC: @sms.clicksend.com. Email is just sent to wordpress user (Send notification to a WordPress user:) without CC.
If I replace ' .$myuser. '@sms.clicksend.com' with email address - CC is sent to this email. Please help.

#525126

Minesh
Supporter

Sprachen: Englisch (English )

Zeitzone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I believe field "cust-phone" is created using Types - correct? If yes: Types field uses prefix "wpcf-" for each custom field.

Could you please try to use following line of code:

function customise_cred_notifications( $post_id, $headers, $formid, $postid, $notification_name, $notification_number ) {
if ($formid==2867 && $notification_number==2) {
$myheaders = array();
$myuser = get_post_meta($post_id, 'wpcf-cust-phone', true);
$myheaders = array( 'CC: ' .$myuser. '@sms.clicksend.com' );
return array_merge($headers, $myheaders);
}
}
add_filter('cred_mail_header', 'customise_cred_notifications', 10, 5);
Dieses Ticket ist jetzt geschlossen. Wenn Sie ein Toolset Kunde sind und Hilfe benötigen, eröffnen Sie bitte ein neues Support-Ticket.