Add a Field in WPForms via functions.php

109 Views Asked by At

I am using WPForms for a basic Formular with two fields: Kartennummer (Customer Card Number) And E-Mail

After submitting the form the goal is, that the customer receives an email with his current money value on its customer card.

For this a have the following in my functions.php

function wpf_guthaben_abfragen( $fields, $entry, $form_data ) {


  if ( absint( $form_data[ 'id' ] ) !== 4463 ) {
    return $fields;
  } 

  // Curl request to get the value from the database
  $guthaben;
} 
add_action( 'wpforms_process', 'wpf_guthaben_abfragen', 10, 3 );

How can I add a field or variable to &fields that has the value $guthaben which is than shown in the notifications mail.

Regards Georg

0

There are 0 best solutions below