Contact Us

Contact Us

Call us Today

(206) 339-1199

Send us Email

dcauto.wa@gmail.com

Let’s get Connected with us

    1221 Alexander Ave E Tacoma
    WA 98421 United States

    View our services
    08

    Years Completed

    10000 +

    Projects Completed

    10000

    Happy Customers

    Request a Quote
    /** * Intercept CF7 submission to handle dynamic car arrays */ add_action( 'wpcf7_before_send_mail', 'dc_autos_merge_car_data' ); function dc_autos_merge_car_data( $contact_form ) { $submission = WPCF7_Submission::get_instance(); if ( $submission ) { // We look directly at the PHP $_POST because CF7 ignores array names like car_year[] if ( isset($_POST['car_year']) && is_array($_POST['car_year']) ) { $years = $_POST['car_year']; $makes = $_POST['car_make']; $models = $_POST['car_model']; $car_html_rows = ""; for ($i = 0; $i < count($years); $i++) { $count = $i + 1; // Build the table rows for each car $car_html_rows .= " Car #$count Year: " . sanitize_text_field($years[$i]) . " Make: " . sanitize_text_field($makes[$i]) . " Model: " . sanitize_text_field($models[$i]) . " "; } // Swap [all-car-details] in the email with our new HTML rows $mail = $contact_form->prop( 'mail' ); $mail['body'] = str_replace( '[all-car-details]', $car_html_rows, $mail['body'] ); // Save changes back to the form properties $contact_form->set_properties( array( 'mail' => $mail ) ); } } }