I just can't figure this out. I'm using the HTML to PDF action and it's working great except I can't get the pdf to attach to an email.
I'm not saving the pdf to the server as this will end up being too much as time goes on.
I have tried just about everything I can think of but no go. I have the data/file named cf_pdf_files in the pdf action and have included this in the GH email action also but it's not attaching. Is there a certain way the actions have to be for this to work? Right now it's as follows:
Multipage
TCPDF
EMAIL
I've tried looking at the debug data but it seems that once the pdf action is fired, it's not saving to the data array or at least I can't see that it is. Does the file need to be saved to the server in order to attach it?
I'm not saving the pdf to the server as this will end up being too much as time goes on.
I have tried just about everything I can think of but no go. I have the data/file named cf_pdf_files in the pdf action and have included this in the GH email action also but it's not attaching. Is there a certain way the actions have to be for this to work? Right now it's as follows:
Multipage
TCPDF
I've tried looking at the debug data but it seems that once the pdf action is fired, it's not saving to the data array or at least I can't see that it is. Does the file need to be saved to the server in order to attach it?
Thanks for the quick response Bob.
I'll have a look at those faq's.
I see one other problem though, if I save the pdf's, how will I know which one to attach as I don't see how the file name can be dynamic? I know it adds a timestamp to it but that doesn't do much to know which file belongs to whom. Do you know if there is a way to have the name be dynamic? I've tried saving the file to my own created folder with no luck, so that doesn't seem to be an option.
I'll have a look at those faq's.
I see one other problem though, if I save the pdf's, how will I know which one to attach as I don't see how the file name can be dynamic? I know it adds a timestamp to it but that doesn't do much to know which file belongs to whom. Do you know if there is a way to have the name be dynamic? I've tried saving the file to my own created folder with no luck, so that doesn't seem to be an option.
Hi gabedaly,
I think that the PDF action adds the file name and path to the $form->data array so you can use those value to attach it to the email.
I don't have the PDF action installed at the moment to check. Does it not give you an option about where to save the file? If it doesn't then you can easily use the Joomla! JFile methods in a Custom Code action to move it.
Bob
I think that the PDF action adds the file name and path to the $form->data array so you can use those value to attach it to the email.
I don't have the PDF action installed at the moment to check. Does it not give you an option about where to save the file? If it doesn't then you can easily use the Joomla! JFile methods in a Custom Code action to move it.
Bob
It would be most excellent if it was added to the $form->data. It would certainly be much easier to work with. But I can't see it and the Email action doesn't pick it up whether I save it to the server or not. I don't know, maybe I'm doing something wrong. Reading through the "Cleanup FAQ" this would work. I just can't get the file name to be dynamic. I'll keep playing around but when you have time, could you consider trying the action out also.
Thanks, Gabe
Thanks, Gabe
Hi gabedaly,
I installed a copy and this is what I see from the code - but needs testing!
If you leave the Document/File name box empty then the action will assign a semi-dynamic name of the form 'form_name_datetime'.
The form name, path and URL are included in the $form->files array as $form->files['name'], $form->files['path'], and $form->files['link']
The form name is also included in the $form->data array using the variable name set in the 'File name in Data/Files array' box e.g. $form->data['cf_pdf_file']
Hope this helps
Bob
I installed a copy and this is what I see from the code - but needs testing!
If you leave the Document/File name box empty then the action will assign a semi-dynamic name of the form 'form_name_datetime'.
The form name, path and URL are included in the $form->files array as $form->files['name'], $form->files['path'], and $form->files['link']
The form name is also included in the $form->data array using the variable name set in the 'File name in Data/Files array' box e.g. $form->data['cf_pdf_file']
Hope this helps
Bob
Thanks Bob for taking the time!
Can you please tell me what order you had the action list setup in order to see the pdf array info?
I can't seem to get it in either the debugger or print_r.
Thanks,
Gabe
Can you please tell me what order you had the action list setup in order to see the pdf array info?
I can't seem to get it in either the debugger or print_r.
Thanks,
Gabe
Hi Gabe,
I looked in the code rather than use a Debugger.
Having a Debugger after the PDF action should work OK as long as you have the PDF action set to save to the server. If it's an immediate download then the download code takes over and effectively kills any remaining ChronoForms actions.
Bob
I looked in the code rather than use a Debugger.
Having a Debugger after the PDF action should work OK as long as you have the PDF action set to save to the server. If it's an immediate download then the download code takes over and effectively kills any remaining ChronoForms actions.
Bob
Hi,
Im have the same issue and just wanted to know what your solution was for this.. what did you end up inputting into the Email attachment field? an array variable?
Thankyou
Im have the same issue and just wanted to know what your solution was for this.. what did you end up inputting into the Email attachment field? an array variable?
Thankyou
Thankyou for the prompt response GreyHead!
Ive looked over the FAQ article you mentioned but could not work out what to add to the email attachment field...
..I added cf_pdf_file but got nothing.. I tried adding cf_pdf_file[0] thinking it needed to know which part of the array but again got nothing.
My debugger results for the attachment are coming up as:
Attachments:
array ( )
Any further assistance would be greatly appreciated!
Ive looked over the FAQ article you mentioned but could not work out what to add to the email attachment field...
..I added cf_pdf_file but got nothing.. I tried adding cf_pdf_file[0] thinking it needed to know which part of the array but again got nothing.
My debugger results for the attachment are coming up as:
Attachments:
array ( )
Any further assistance would be greatly appreciated!
After further investigation into my issue I have come up with the solution.
I had my HTML to PDF option set to 'View' instead of 'Controller' (found this out thanks to GreyHeads response on another post)
So I can now add the filename 'cf_pdf_file' to my email attachment field in the Email option bar.
Thankyou!
I had my HTML to PDF option set to 'View' instead of 'Controller' (found this out thanks to GreyHeads response on another post)
So I can now add the filename 'cf_pdf_file' to my email attachment field in the Email option bar.
Thankyou!
This topic is locked and no more replies can be posted.