Problem: I would like to add the PayPal IPN, the WooCommerce Order ID, and the payment date to a Forms email notification.
Solution:
You can create custom placeholders using the cred_body_notification_codes and cred_subject_notification_codes APIs, and access any information about the Order using the post ID from the $_REQUEST superglobal:
add_filter('cred_body_notification_codes', 'custom_generic_field_notification'); add_filter('cred_subject_notification_codes', 'custom_generic_field_notification'); function custom_generic_field_notification( $defaultPlaceHolders ) { $order_id = ''; $completed_date = ''; $date_format = 'Y-m-d'; if( isset($_REQUEST['post'][0])) { $order_id = $_REQUEST['post'][0]; $completed_date = date($date_format, get_post_meta($order_id, '_date_completed', true)); } $newPlaceHolders = array( '%%ORDER_ID%%' => $order_id, '%%COMPLETED_DATE%%' => $completed_date, ); return array_merge($defaultPlaceHolders, $newPlaceHolders ); }
I'm not sure how the PayPal IPN is stored in the database, but you can use the Order ID to query postmeta as needed.
Relevant Documentation:
https://toolset.com/documentation/user-guides/how-to-use-custom-placeholders-in-cred-notifications/
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.
Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
Este tema contiene 6 respuestas, tiene 2 mensajes.
Última actualización por hace 6 años, 5 meses.
Asistido por: Christian Cox.