Attach PDF

Daanoz 17 Feb, 2016
Hey guys,
I found the TCPDF Today it is amazing.

But only one thing fails me. and just do not know how to do it exactly.

i have a simple form and make a PDF and its saving to my sever. but how can i mail it i try to do at this cf_pdf_file Attachment files,

hope you can help my
Daanoz 17 Feb, 2016
already found that page but not understand it. how to do it
GreyHead 18 Feb, 2016
1 Likes
Hi Daanoz,

Please drag a Debugger action into the On Submit event, then submit the form and post the debug - including the 'dummy emails' results here.

Bob
Daanoz 18 Feb, 2016
Array
(
    [6] => Array
        (
            [TCPDF] => Array
                (
                    [0] => pdfs/Lid-worden/Aanmeldingsformulier_20160218111624.pdf has been saved correctly.
                )

        )

    [3] => Array
        (
            [Email] => Array
                (
                    [0] => An email with the details below was sent successfully:
                    [1] => To:seneschalk@dielanden.nlD,  tresorier@dielanden.nlD,  canselier@dielanden.nlD,  websmede@dielanden.nl , daan9431@gmail.com
                    [2] => Subject:Aanmelding nieuw Lid
                    [3] => From name:LHO 
                    [4] => From email:websmede@dielanden.nl
                    [5] => CC:
                    [6] => BCC:
                    [7] => Reply name:
                    [8] => Reply email:
                    [9] => Attachments:
                    [10] => Array
                        (
                        )

                    [11] => Body:
<table>
<tr><td></td><td></td></tr>
<tr><td>Voornaam</td><td>Daan</td></tr>
<tr><td>Achternaam</td><td></td></tr>
<tr><td>Geboortedatum</td><td></td></tr>
<tr><td>Huisnummer</td><td></td></tr>
<tr><td>Adres</td><td></td></tr>
<tr><td>Woonplaats</td><td></td></tr>
<tr><td>Postcode</td><td></td></tr>
<tr><td>E-mail adres</td><td></td></tr>
<tr><td>Hoe je de LHO</td><td>{Hoe je de LHO}</td></tr>
<tr><td>Anders</td><td></td></tr>
<tr><td>Wat is reden dat je lid wil worden</td><td>nee</td></tr>
<tr><td>Heb je verder nog vragen</td><td>{Heb je verder nog vragen}</td></tr>
<tr><td>Vul hier je vraag in.</td><td></td></tr>
<tr><td>Captcha</td><td></td></tr>
<tr><td></td><td></td></tr>
<tr><td></td><td>1</td></tr>
</table><br /><br />IP: 94.215.29.53
                )

        )

)
GreyHead 18 Feb, 2016
Hi Daanoz,

Looking in the background of your image it looks as though the Email action is before the TCPDF action- if that is correct, there is no file to attach when the Email is sent.

Bob
Daanoz 23 Feb, 2016
Hey GrayHead

I changed that, check the attached photo. But is doesn't seems the problem.

hereby the debug information:

Array
(
    [option] => com_chronoforms5
    [chronoform] => Lid-worden
    [event] => submit
    [Ikwillidbug] => Lid worden
    [Voornaam] => Daan
    [Achternaam] => Lindeman
    [Geboortedatum] => 23 april 1991
    [Adres] => Peitereynstraat
    [Huisnummer] => 83
    [Postcode] => 8022 TC
    [Woonplaats] => zwolle
    [Email] => daan9431@gmail.com
    [HoejedeLHO] => Via Google
    [Anders] => 
    [Motivatie] => WIl ik niet
    [Hebjeverdernogvragen] => Nee
    [Hebjenogvragenja] => 
    [captcha] => 
    [Akkoord] => 1
    [button12] => Verzenden
    [cf_pdf_file] => Lid-worden_20160223142035.pdf
    [ip_address] => 94.215.29.53
)
Array
(
    [cf_pdf_file] => Array
        (
            [name] => Lid-worden_20160223142035.pdf
            [path] => pdfs/Lid-worden/Lid-worden_20160223142035.pdf
            [size] => 0
            [link] => pdfs/Lid-worden/Lid-worden_20160223142035.pdf
        )

)
Errors
Array
(
)
Debug Info
Array
(
    [8] => Array
        (
            [TCPDF] => Array
                (
                    [0] => pdfs/Lid-worden/Lid-worden_20160223142035.pdf has been saved correctly.
                )

        )

    [3] => Array
        (
            [Email] => Array
                (
                    [0] => An email with the details below was sent successfully:
                    [1] => To:seneschalk@dielanden.nlD,  tresorier@dielanden.nlD,  canselier@dielanden.nlD,  websmede@dielanden.nl , daan9431@gmail.com
                    [2] => Subject:Aanmelding nieuw Lid
                    [3] => From name:LHO 
                    [4] => From email:websmede@dielanden.nl
                    [5] => CC:
                    [6] => BCC:
                    [7] => Reply name:
                    [8] => Reply email:
                    [9] => Attachments:
                    [10] => Array
                        (
                        )

                    [11] => Body:
<table>
<tr><td></td><td></td></tr>
<tr><td>Ja ik wil </td><td>Lid worden</td></tr>
<tr><td>Voornaam</td><td>Daan</td></tr>
<tr><td>Achternaam</td><td>Lindeman</td></tr>
<tr><td>Geboortedatum</td><td>23 april 1991</td></tr>
<tr><td>Adres</td><td>Peitereynstraat</td></tr>
<tr><td>Huisnummer</td><td>83</td></tr>
<tr><td>Postcode</td><td>8022 TC</td></tr>
<tr><td>Woonplaats</td><td>zwolle</td></tr>
<tr><td>E-mail adres</td><td>daan9431@gmail.com</td></tr>
<tr><td>Hoe je de LHO</td><td>Via Google</td></tr>
<tr><td>Anders</td><td></td></tr>
<tr><td>Wat is reden dat je lid wil worden</td><td>WIl ik niet</td></tr>
<tr><td>Heb je verder nog vragen</td><td>Nee</td></tr>
<tr><td>Vul hier je vraag in.</td><td></td></tr>
<tr><td>Captcha</td><td></td></tr>
<tr><td></td><td></td></tr>
<tr><td></td><td>1</td></tr>
</table><br /><br />IP: 94.215.29.53
                )

        )

)
GreyHead 23 Feb, 2016
1 Likes
Hi Daanoz,

Is the path setting in the TCPDF action a full absolute path? It looks to me as it if may be relative to the site root? I would expect ti to look more like /my_account/public_html/domain/pdfs/Lid-worden/ instead of just pdfs/Lid-worden/

Bob
Daanoz 23 Feb, 2016
i change it to

/domains/dielanden.nl/public_html/pdfs/Lid-worden/cf_pdf_file.pdf

stil got only a empty mail
GreyHead 23 Feb, 2016
Hi Daanoz,

By all means PM me the site URL, the form name, and a SuperAdmin login and I'll take a quick look.

Bob
GreyHead 24 Feb, 2016
Hi Daanoz,

I made a copy of your form with some changes

+ the full path is /home/h3landen/domains/dielanden.nl/public_html/pds/Lid-worden/ and this goes into the TCPDF action settings.

+ the Email action Attachments box only needs the name from the 'File name in Data/Files array' setting in the TCPDF action: cf_pdf_file

+ I also moved the actions out of the Check Captcha success event - they will work OK there but it's cleaner to avoid the extra nesting.

+ I renamed the form to remove the - which can cause problems with MySQL if you save data into a table. (Basically names with dashes need to be quoted as `table-name` when they are used in queries.)

+ I removed the spaces between the email addresses in the To Email box as ChronoForms sometimes hiccups on these.

+ I changed the Thank you message as {naam} isn't defined anywhere.

+ I added a Debugger action to see the output.

Now the PDF is being created correctly and the Debugger says that an email was sent with the attachment - but I didn't receive the email when I tested so you may need to check that.

Bob
bobysha 26 Feb, 2016
Maybe something is really wrong with the path. Anyway it's difficult ot say something exact without seeing the site structure.
liol i wrote it without noticing Bob's answer =) Sorry =) I hope now all will work correctly and the problem will be solved.
Daanoz 26 Feb, 2016
Great its working fine I one you a coffee😉
This topic is locked and no more replies can be posted.