editing mail_2 output for filenames only
-
I am attempting to include the filename only of uploaded files in the confirmation email (mail 2)
I have tried editing it via ‘wpcf7_additional_email’ filter which should fire directly before sending, but it is not removing the url
// below is find/replace for the domain and path to the file upload location function customize_mail_2($additional_mail, $contact_form) { $submission = WPCF7_Submission::get_instance(); $wpcf7 = WPCF7_ContactForm::get_current(); $additional_mail['mail_2']['body'] = str_replace('{domain}/wp-content/uploads/wp_dndcf7_uploads/wpcf7-files/', '', $additional_mail['mail_2']['body']); return $additional_mail; } add_filter('wpcf7_additional_mail', 'customize_mail_2', 10, 2);
when I replace the line where it does the find/replace with an append, that works, so I know I am in the right area
// example $additional_mail['mail_2']['body'] .= '...' // the "..." will show at end of email
any idea where i may be doing this wrong, or an idea on how to do it correctly?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘editing mail_2 output for filenames only’ is closed to new replies.