From 825083ec5dbc4c43e78ce233e58ac3992426f286 Mon Sep 17 00:00:00 2001 From: n3storm Date: Tue, 29 Jul 2025 11:10:59 +0000 Subject: [PATCH] not in use --- forms.php | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 forms.php diff --git a/forms.php b/forms.php deleted file mode 100644 index 9249e76..0000000 --- a/forms.php +++ /dev/null @@ -1,50 +0,0 @@ -CONTACT_FORM = dirname( __FILE__ ).'/templates/solicita-presupuesto.html'; - -$compiled = Timber::compile( CONTACT_FORM, $context ); -$subject_prefix = '[Presupuesto] '; - -$form = new Gregwar\Formidable\Form($compiled); -$form->setLanguage(new Gregwar\Formidable\Language\Spanish); -$messages = array(); -if ($form->posted()) { - if (count($form->check()) == 0) { - $subject = ""; - $body = "\r\n"; - $messages = ["Gracias por contactar!"]; - $to = 'hola@estudionexos.com'; - $subject = $subject_prefix.$form->subject; - $body = $body.$form->message."\r\n\r\n"; - $body = $body.'Nombre'.$form->name."\r\n"; - $body = $body.'Email'.$form->email."\r\n"; - $body = $body.'Organizacion'.$form->organization."\r\n"; - $body = $body.'Acepto las condiciones de polĂ­tica de privacidad'.$form->rgpd."\r\n"; - $post = [ - 'comment_status' => 'closed', - 'ping_status' => 'closed', - 'post_content' => $body, - 'post_title' => $subject, - 'post_status' => 'private', - 'post_type' => 'messages' - ]; - wp_insert_post( $post ); - wp_mail( $to, $subject, $body ); - } else { - $messages = $form->check(); - } -} - -$context['contactform'] = $form; -$context['messages'] = $messages; -$context['check'] = $form->check(); -$context['posted'] = $form->posted(); -$templates = array( 'contacto.twig' ); -//~ if ( is_home() ) { - //~ array_unshift( $templates, 'page.twig' ); -//~ } -Timber::render( $templates, $context );