Sending an attachment via Email with variable input
-
Hello, before start, i’m lovin using form 7, it’s very useful.
I want to know, if is possible to implement an attachment using a variable path?
I tried to use this code, but don’t work.add_filter( 'wpcf7_mail_components', 'mycustom_wpcf7_mail_components' ); function mycustom_wpcf7_mail_components( $components ) { if ($WPCF7->id==656){ $uploads = wp_upload_dir(); define ('COUPON_UPLOAD_PATH',$uploads['path'].'/777'); $WPCF7->posted_data['anoSegvia']=$anosegvia; $WPCF7->posted_data['Mesfatura']=$pdf_Mesfatura; $components['attachments'][] = 'COUPON_UPLOAD_PATH.'/'.$anosegvia.'-'.$pdf_Mesfatura'; } return $components; }
I would be grateful for some help
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Sending an attachment via Email with variable input’ is closed to new replies.