Issues by the “Destination” block
Button Test creates empty files on FTP server
It’s a FTP server limitation. You should edit the job and mark “Passive mode” at tab “FTP”.
I don’t receive emails with attachments
1. If you use XLS format – open section “Email”, checkbox “Append file contents to email body” must be turned OFF.
2. Some mail servers can require additional verification for emails with attachments.
So you should use SMTP plugin, like https://wordpress.org/plugins/wp-mail-smtp/
How to append records to existing CSV file (at FTP server)
You must turn on option “Append to existing file” in section “FTP settings” (inside the job). The plugin will download existing file and pass it to “hook” function. So you have to add following PHP code to section “Misc Settings” (inside the job too!). Probably you should tweak this code a bit.
1 2 3 4 5 6 7 8 9 10 11 |
add_action('woe_ftp_append_CSV',function ($existing_file, $new_file) { // read new lines $lines = file($new_file); // remove first line - you don't need following code if your CSV doesn't have header unset($lines[0]); // kill extra line breaks? $lines = array_map("trim", $lines); //append new lines to existing file $result = file_put_contents($existing_file, join("\n", $lines)."\n", FILE_APPEND); //replace file for upload copy($existing_file, $new_file); }, 10, 2 ); |
I send order as json to API endpoint, but API doesn’t see data
Probably, API waits for HTTP header. Add following code to “Misc Settings” and test again.
1 2 3 4 5 |
// modify Content-Type for HTTP Post ( Pro version) add_filter('wc_order_export_http_args', function ($args) { $args['headers']['Content-Type'] = "application/json"; return $args; }); |