• Resolved kubiq

    (@kubiq)


    Oh god why? Why you made this function add_uploaded_file private?
    How should I attach file to the email now? Please help.
    I need to do it programtically, it is dynamically generated file based on inputs from the form…
    I used

    $submission = WPCF7_Submission::get_instance();
    $submission->add_uploaded_file( 'file', $generated_file );

    now what? There is nothing about that in your documentation ??

Viewing 1 replies (of 1 total)
  • Thread Starter kubiq

    (@kubiq)

    add_action( 'wpcf7_before_send_mail', 'my_dynamic_attachments' );
    function my_dynamic_attachments( $cf7 ){
    	// use $_POST for getting form data
    	$properties = $cf7->get_properties();
    	$properties['mail']['attachments'] = SOME_FILE_PATH;
    	$cf7->set_properties( $properties );
    }
Viewing 1 replies (of 1 total)
  • The topic ‘add_uploaded_file’ is closed to new replies.