Leo
Forum Replies Created
-
Forum: Plugins
In reply to: [My Login Logout Plugin] Login in menuHi
sorry for reopening the subject, but where can I select the menu location, i can’t see login/logout anywhere.Thanks
Forum: Plugins
In reply to: [Contact Form 7] Default values from context not workingIt does not work for me too.
Forum: Plugins
In reply to: [Contact Form 7] Sending an attachment via Email with variable inputI solved the problem with this code
add_action('wpcf7_before_send_mail', 'wpcf7_update_email_body'); function wpcf7_update_email_body($contact_form) { $submission = WPCF7_Submission::get_instance(); if ( $submission ) { /* DEFINE CONSTANT AND GET FPDF CLASSES */ define ('PDF_PATH', 'wp-content/uploads/777/'); // MAKE SURE THIS POINTS TO THE DIRECTORY IN YOUR THEME FOLDER THAT HAS PDF $posted_data = $submission->get_posted_data(); // FORM FIELD DATA AS VARIABLES $mes = $posted_data['mes']; define ('PDF_PATH2', PDF_PATH.$mes.'.pdf'); } } add_filter( 'wpcf7_mail_components', 'mycustom_wpcf7_mail_components' ); function mycustom_wpcf7_mail_components($components){ if (empty($components['attachments'])) { $components['attachments'] = array( PDF_PATH2 ); // ATTACH THE PDF THAT WAS chosen ABOVE } return $components; }
Forum: Plugins
In reply to: [Contact Form 7] dynamically attach multiple filesI solved the problem with this code
add_action('wpcf7_before_send_mail', 'wpcf7_update_email_body'); function wpcf7_update_email_body($contact_form) { $submission = WPCF7_Submission::get_instance(); if ( $submission ) { /* DEFINE CONSTANT AND GET FPDF CLASSES */ define ('PDF_PATH', 'wp-content/uploads/777/'); // MAKE SURE THIS POINTS TO THE DIRECTORY IN YOUR THEME FOLDER THAT HAS PDF $posted_data = $submission->get_posted_data(); // FORM FIELD DATA AS VARIABLES $mes = $posted_data['mes']; define ('PDF_PATH2', PDF_PATH.$mes.'.pdf'); } } add_filter( 'wpcf7_mail_components', 'mycustom_wpcf7_mail_components' ); function mycustom_wpcf7_mail_components($components){ if (empty($components['attachments'])) { $components['attachments'] = array( PDF_PATH2 ); // ATTACH THE PDF THAT WAS chosen ABOVE } return $components; }
Forum: Plugins
In reply to: [Contact Form 7] dynamically attach multiple filesThanks anyway, but I have to find a solution, I really need a code to attach files dynamically with the data placed in the form.
Forum: Plugins
In reply to: [Contact Form 7] dynamically attach multiple filessecretfamiliesmc hello, sorry for my bad english, please can you tell me if this is how to apply the code? I’m days trying to implement this code without success, my data is acquired in drop-down box.
add_filter( 'wpcf7_mail_components', 'mycustom_wpcf7_mail_components1' ); function mycustom_wpcf7_mail_components1( $components ) { $myDocName = $WPCF7_Form->posted_data['Mesfatura'].".pdf"; $components['attachments'] = "uploads/777/".$myDocName ; return $components; }
what I want is, with the data from drop-down [‘Mesfatura’] select a pdf attachment with the same name. Already tried hundreds of ways and I can’t find a solution.
I would really appreciate any help you can give me.