How to attach dynamic created pdf as email attachment

madhur31 05 May, 2014
HI,
I have create one form using chronoform V5 and saving all fields to database and even creating pdf using plugin given of TCPDF.
now as pdf is generated i want to be able to send this pdf as attachment to email to the user. i am able to create pdf which is saving with date string in a name, so how i add pdf as attachment to user.
Please guide.
Max_admin 05 May, 2014
Answer
Hi madhur31,

There is a PDF setting called "Post field name" (or File name in Data/Files array), just input a virtual field name there, like "my_pdf" and then enter the same string in the "attachments fields names" setting in the "Email" action settings!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
sercio 11 Mar, 2015
Hi,
i have done this... but the mail have not the attach....
I must to put the field of file name between square?
sercio 11 Mar, 2015
Or i must to patch the componente (if ( $PDF_view == 'I' || $PDF_view == 'FI' ) {
$mainframe =& JFactory::getApplication();
$mainframe->close();
}) ???
Max_admin 11 Mar, 2015
No, it should work after the install, if it doesn't then please post a screenshot for your PDF settings and for the "attachment" setting in your Email.

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
sercio 11 Mar, 2015
HI,
thank you for the answer.
Here the screenshots:

[attachment=0]image-1.jpg[/attachment]

[attachment=1]image-2.jpg[/attachment]
Max_admin 12 Mar, 2015
Your settings are correct, please add a debugger action to the end of the "on submit" event and post the debug report so we can check what's happening.

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
sercio 12 Mar, 2015
Thanks.
This is the debbugger result:

Data Array:

Array
(
    [option] => com_chronoforms
    [lang] => it
    [chronoform] => pre-iscrizione-menneadi
    [event] => submit
    [Itemid] => 
    [nome] => Mario Rossi
    [mail] => serciolo1@gmail.com
    [telefono] => 3357252679
    [comeconosciuto] => Internet
    [Adulti] => 3
    [bambini] => 4
    [Mezzo] => Auto privata
    [messaggio] => test
    [privacy] => 1
    [input_submit_3] => Invia
    [33dd2755d933c83770b8efc79afabb00] => 1
    [language] => it-IT
    [chronoform_data] => Array
        (
            [cf_uid] => 9848122c92c23f94fbce1f2d12391984
            [cf_created] => 2015-03-12 09:12:18
            [cf_created_by] => 0
            [cf_ipaddress] => 212.102.67.40
            [cf_user_id] => 0
            [option] => com_chronoforms
            [lang] => it
            [chronoform] => pre-iscrizione-menneadi
            [event] => submit
            [Itemid] => 
            [nome] => Mario Rossi
            [mail] => serciolo1@gmail.com
            [telefono] => 3357252679
            [comeconosciuto] => Internet
            [Adulti] => 3
            [bambini] => 4
            [Mezzo] => Auto privata
            [messaggio] => test
            [privacy] => 1
            [input_submit_3] => Invia
            [33dd2755d933c83770b8efc79afabb00] => 1
            [language] => it-IT
            [cf_id] => 46
        )

    [chronoform_data_cf_id] => 46
)

Validation Errors:

Array
(
)


Grazie. Abbiamo ricevuto il tuo messaggio. Sarai ricontattato nel giro di qualche giorno.

Debug Data

    email
        0
            Result An email has been SENT successfully from (Mario Rossi)serciolo1@gmail.com to serciolo@hotmail.com
            Body Prenotazione Ritiro a Lecceto del 22 e 23 Marzo 2014 Nome: Mario Rossi E-mail serciolo1@gmail.com Numero di telefono: 3357252679 Numero Adulti: 3 Numero Bambini: 4 Mezzo di Trasporto: Auto privata Note: test Submitted by 212.102.67.40
            Attachments array ( )
        4
            Result An email has been SENT successfully from (Parrocchia di Santa Prisca)s.prisca@tiscali.it to serciolo1@gmail.com
            Body Abbiamo ricevuto il tuo messaggio. Sarai ricontattato nel giro di qualche giorno.
            Attachments array ( )
    /web/htdocs/www.santaprisca.it/home/components/com_chronoforms/pdf/pre-iscrizione-menneadi/pre-iscrizione-menneadi_20150312091218.pdf has been uploaded OK.
sercio 13 Mar, 2015
Hi,
The attach don't work.... adn if i select other options (Download, view, tec etc) i can't use a thanks page (the thaks page is not showed, the browser remain on the form page).
All other (Html to pdf) work fine. Any idea?
Max_admin 13 Mar, 2015
You receive both emails without attachments ?

If your form is not big you can install v5 on the same site (don't uninstall your current v4) and test the PDF on v5 which should work fine, it also has some debug output.

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
sercio 13 Mar, 2015
Hi,
yes, i have received both the mails....

I can try the v5. Is'it possible to install without uninstall the v4?
sercio 13 Mar, 2015
Hi,
I have tried, but i get the following error on action install:

Fatal error: Class 'ZipArchive' not found in /web/htdocs/www.santaprisca.it/home/administrator/components/com_chronoforms5/chronoforms/chronoforms.php on line 502
sercio 16 Mar, 2015
Hi,
with a little change in php.ini (my provider permit this) i have installed the action and all works fine, also the attach in the e-mail.
Thank you
sercio 16 Mar, 2015
Just another question, How i acn remove header and footer (and page number) from the pdf file created?
sercio 16 Mar, 2015
Ehm, sorry, a
nd where the pdf document is saved (by default)?
sercio 16 Mar, 2015
Ok found...
This topic is locked and no more replies can be posted.