Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter dadadesign

    (@dadadesign)

    Hello Raihan,

    Thank you for your quick reply!

    I just wanted to know if the plugin allows routing emails with attachments such as images, videos, or other files to different recipients.

    I haven’t found any information about attachments, but I assume it’s possible and just wanted to ask before testing it myself.

    Thread Starter dadadesign

    (@dadadesign)

    Michael, that’s it! I’m very happy with the solution you found.
    Thank you very very much for your time, effort and your great and super fast support! It was a real pleasure for me to make a donation. If it’s not too much to ask, I would like to come back to you, if I’ve got the rather unlikely need to use the short code in a custom field like in my first set up.

    Thread Starter dadadesign

    (@dadadesign)

    Michael, thank you again for your time and effort to structure my problem!
    To my understanding your description is perfectly right. I don’t know how to do #4 and #5. To put my goal in own words: I want the post to have automatically [star rating=”X”] short code in it, where X should be the numeric value from the custom field.

    Hi KCC24,
    for days now I’m trying to use TCPDF, but it doesn’t seem to work. Even without image the submit button loads forever, no email is sent and no pdf created. The code I’m using is originally the same as yours. My adaption for using it with TCPDF looks like this:

    add_action('wpcf7_before_send_mail', 'wpcf7_update_email_body');
    // add Contact Form 7 to PDF function
    
    	function wpcf7_update_email_body($contact_form) {
    
        $submission = WPCF7_Submission::get_instance();
        if ( $submission ) {
    
    // Include the main TCPDF library (search for installation path).
    require_once('tcpdf/examples/tcpdf_include.php');
    
    	$posted_data = $submission->get_posted_data();
        // SAVE FORM FIELD DATA AS VARIABLES
        $vorname = $posted_data["meta_guest-author"];
    	$nachname = $posted_data["nachname"];
    	$alter	 = $posted_data["meta_alter"];
        $strasse = $posted_data["strasse"];
    	$hausnummer = $posted_data["hausnummer"];
    	$plz = $posted_data["plz"];
        $ort = $posted_data["ort"];
    
    $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
    
        $pdf->AddPage();
    
    	$pdf->Write(5,'Vorname: ');
    	$pdf->SetFont('Arial','',11);
        $pdf->Write(5,$vorname . "\n\n");
        $pdf->SetFont('Arial','B',11);
    	$pdf->Write(5,'Nachname: ');
        $pdf->SetFont('Arial','',11);
    	$pdf->Write(5,$nachname . "\n\n");
    	 $pdf->SetFont('Arial','B',11);
    	$pdf->Write(5,'Alter: ');
        $pdf->SetFont('Arial','',11);
    	$pdf->Write(5,$alter . "\n\n");
    	 $pdf->SetFont('Arial','B',11);
    	$pdf->Write(5,'Str.: ');
        $pdf->SetFont('Arial','',11);
    	$pdf->Write(5,$strasse . "\n\n");
    	 $pdf->SetFont('Arial','B',11);
    	$pdf->Write(5,'Hausnummer: ');
        $pdf->SetFont('Arial','',11);
    	$pdf->Write(5,$hausnummer . "\n\n");
    	 $pdf->SetFont('Arial','B',11);
    	$pdf->Write(5,'PLZ: ');
        $pdf->SetFont('Arial','',11);
    	$pdf->Write(5,$plz . "\n\n");
    	 $pdf->SetFont('Arial','B',11);
    	$pdf->Write(5,'Ort: ');
        $pdf->SetFont('Arial','',11);
    	$pdf->Write(5,$ort . "\n\n");
    	 $pdf->SetFont('Arial','B',11);
    
    	$pdf->Output('test.pdf', 'F');
        }
        }
    
        add_filter( 'wpcf7_mail_components', 'mycustom_wpcf7_mail_components' );
        function mycustom_wpcf7_mail_components($components){
        if (empty($components['attachments'])) {
        $components['attachments'] = array('test.pdf'); // ATTACH THE NEW PDF THAT WAS SAVED ABOVE
        }
        return $components;
        }

    Do you have a clue, why it’s not working?

    Thank you!

    dadadesign

    Thread Starter dadadesign

    (@dadadesign)

    Michael, thank you very much for your super fast response!
    What I’m trying to do, is to transfer and display the star ratings users give in CF7 (via plugin Star Rating with font Awesome; field is set up as post meta) to/in the post they – thanks to your plugin – automatically create. Yet this delivers the pure numbers, say X from 0-5, of the rating. So I use a second plugin, which uses shortcodes to display star ratings in the post and enable my custom field to accept shortcode with “echo do_shortcode”. Now I’m hoping to find a solution to wrap the shortcode “[star rating=”X”]” around the number to display the stars of the rating in the post. Maybe this sounds a bit weird, but I’m not a coder.

    Hi KCC24,

    thank you very much!

    I will give TCPDF a try.

    dadadesign

    Hello!

    We have got exactly the same problem here: the attempt to use an image in the pdf filled with dynamic content from Contact Form 7 results in a submit button that keeps loading forever and no email is sent.

    We did a lot ot testing and think FPDF is not to blame.

    Any Suggestions to solve this problem are greatly appreciated!

Viewing 7 replies - 1 through 7 (of 7 total)