Support » Plugin: Contact Form 7 » add programmmaticaly file .vcf to contact form

  • i tried to add programmaticaly a file attachement to the contact form but to not avial
    `$mail[‘body’] .= ‘<p>An extra paragraph at the end!</p>’.$vcards;
    $mail[‘subject’] = “Well, hello, Dolly”;

    $cfdata->uploaded_files = array( ‘vcard’ => $vcards );
    $submission->add_uploaded_file(‘csv’, ‘http://new.gooby.co.il/wp-content/uploads/mqikis.vcf’);
    $cfdata->set_properties(array(‘mail’ => $mail));`

    vcard is the name of the field of the file attachement in contact form7
    I GET the body and the subject like i wrote here but can’t get the attachement!

    i tried also
    add_action(‘wpcf7_before_send_mail’,’send_vcf’);
    function send_vcf( $cf7 ) {
    $id = $cf7->id();
    if ($id!=741){
    $submission = WPCF7_Submission::get_instance();
    $submission->add_uploaded_file(‘vcf’, ‘http://new.gooby.co.il/wp-content/uploads/mqikis.vcf’);
    }
    }
    thank you

    https://wordpress.org/plugins/contact-form-7/

  • The topic ‘add programmmaticaly file .vcf to contact form’ is closed to new replies.