/** * Save RockAutoCare Contact Form 7 submissions to PostgreSQL. * * Database: public.sales_leads * Fixed values: * source = rock * status = Open */ error_log( 'Rock leads: functions.php loaded.' ); add_action( 'wpcf7_before_send_mail', 'rock_save_lead_to_postgresql' ); function rock_save_lead_to_postgresql( $contact_form ) { error_log( 'Rock leads: CF7 hook reached.' ); // Get the submitted form data. $submission = WPCF7_Submission::get_instance(); if ( ! $submission ) { error_log( 'Rock leads: Could not get Contact Form 7 submission.' ); return; } $posted_data = $submission->get_posted_data(); // Get form values. $year = sanitize_text_field( $posted_data['select-year'] ?? '' ); $make = sanitize_text_field( $posted_data['select-make'] ?? '' ); $model = sanitize_text_field( $posted_data['selected_model'] ?? '' ); $part = sanitize_text_field( $posted_data['Selected-part'] ?? '' ); $name = sanitize_text_field( $posted_data['your-name'] ?? '' ); $number = sanitize_text_field( $posted_data['Your-number'] ?? '' ); $email = sanitize_email( $posted_data['your-email'] ?? '' ); // Basic validation. if ( empty( $name ) || empty( $number ) || empty( $email ) || empty( $part ) ) { error_log( 'Rock leads: Required form fields are missing.' ); return; } /** * Connect to Supabase PostgreSQL. * * Replace these values with your actual Session Pooler details. */ $conn = pg_connect( "host=aws-1-ap-south-1.pooler.supabase.com" . "port=5432". "dbname=postgres". "user=postgres.cybpqfhfpsxuprixnwvs". "password=6dRy9Zx$?LtB#Wx". "sslmode=require" ); if ( ! $conn ) { error_log( 'Rock leads: PostgreSQL connection failed.' ); return; } // Insert into the existing sales_leads table. $result = pg_query_params( $conn, 'INSERT INTO public.sales_leads ( customer_name, mobile_no, email, year, make, model, part, source, status ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)', array( $name, $number, $email, $year, $make, $model, $part, 'rock', 'Open', ) ); if ( ! $result ) { error_log( 'Rock leads: PostgreSQL insert failed. Error: ' . pg_last_error( $conn ) ); } else { error_log( 'Rock leads: Lead successfully inserted into sales_leads.' ); } // Close PostgreSQL connection. pg_close( $conn ); } is this correct ? Buy Commerical Vehicles Engine Online

Get Commerical Vehicle Used Engine & Transmission in "A" Grade Condition

Secure your purchase with a 10% off on your order! Call Us


    By providing your information, you opting into SMS notifications from Rock Auto Care LLC! You will now receive updates regarding your orders and support. To opt out at any time, reply STOP. To opt back in at any time reply START We Do Not Sell Your Information. check out our Privacy Policy

    tick-png

    Great news! is available in stock. Fill out the below details to call you.




    Used Mitsubishi Engines

    Mitsubishi engines are known for their reliability and performance in various vehicles, including cars, trucks, and industrial machinery. Opting for a used Mitsubishi engine offers a cost-effective solution without compromising on quality. These engines are designed to deliver robust performance and longevity, making them a popular choice for many applications.

    Benefits of Used Mitsubishi Engines

    • Cost Savings: Significant reduction in upfront costs compared to new engines.
    • Proven Reliability: Known for long-lasting and dependable performance.
    • Wide Availability: Extensive market presence ensures a variety of options.
    • Compatibility: Suitable for various applications, from cars to industrial machinery.

    2,000 Inventory yards

    Providing Excellent Service

    Follow-up online

    There are no hidden fees

    Find Quality Used Auto Engine Today!

    Available Online Free Shipping & Warranty

    Popular Brands

    We provide quality used engines of nearly all the popular brands.

    Scroll to Top