Get attachment in before_send_mail actionfilter

[ad_1]

Hi there,

I need to get the attachment which is uploaded when sending the form, because I want to resend it to an API.
The problem: I cant seem to get the attachment.
Within my action code, theres this:

$form_id = $contact_form->id();
$submission = WPCF7_Submission::get_instance();
$posted_data = $submission->get_posted_data();

Within my $posted_data-Variable, I see the name of the attachment and all the other fields which are getting posted. So something is happening. But with $submission->uploaded_files();, the array is just empty.

As I said, I need to send the attachment to another API, so I need that before it get sent (and hence deleted) from CF7.

Anyone help please?

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer