Home › Forums › Quform WordPress › thenewsletter plugin and quform2 :-) › Reply To: thenewsletter plugin and quform2 :-)
October 24, 2023 at 8:21 am #36094
deranaloge
Participant
hm now i tried something myself:
add_filter(‘quform_post_process_2’, function($result, $form) {
if (class_exists(‘TNP_Subscription’)) {
$email = $form->getValue(‘quform_2_4’);
if (!empty($email)) {
$name = $form->getValue(‘quform_2_3’);
$subscription = new TNP_Subscription();
$subscription->email = $email;
$subscription->first_name = $name[2];
$subscription->last_name = $name[4];
$subscription->lists = array(1);
$subscription->send_welcome = true; // Setzen Sie dies auf true, um die Willkommens-E-Mail zu senden
TNP::subscribe2($subscription);
}
}
return $result;
}, 10, 2);
but i got an ajax error now…