Not clear on how to add a TCPDF form link to email or Thank you message.
Successfully given the form as attachment with e-mail.
Refering to
https://www.chronoengine.com/faqs/61cfv4/cfv4tutorials/4133howcanicreateapdfincludingformresults.html
But not getting it.
If I add the code
Successfully given the form as attachment with e-mail.
Refering to
https://www.chronoengine.com/faqs/61cfv4/cfv4tutorials/4133howcanicreateapdfincludingformresults.html
But not getting it.
If I add the code
<?php
$form‐>data['pdf_link'] = "<a href='{$form>
files['cf_pdf_file']['link']}' >Click here</a>";
?>
to my e-mail message, I do not get anything in e-mail.
Hi santosh,
Please check your PHP and add the missing - in $form->files
Bob
Please check your PHP and add the missing - in $form->files
<?php
$form‐>data['pdf_link'] = "<a href='{$form->files['cf_pdf_file']['link']}' >Click here</a>";
?>
Bob
I am confused on where to add the code.
I added in 'Email template' box as shown.
But not getting any text in the email (except IP address).
I added in 'Email template' box as shown.
But not getting any text in the email (except IP address).
Hi santosh,
. . . use a Custom Code action after the TCPDF action and before the Email action with code like this:
Bob
. . . use a Custom Code action after the TCPDF action and before the Email action with code like this:
<?php
$form->data['pdf_link'] = "<a href='{$form->files['cf_pdf_file']['link']}' >Click here</a>";
?>
Then you would add {pdf_link} to your Email template or Thank You page action.
Bob
Tried. But still the email is blank (only IP address)
HI santosh,
There is nothing to see in the action. Please drag the Debugger down so that you can see what is being created by the Custom code.
Bob
There is nothing to see in the action. Please drag the Debugger down so that you can see what is being created by the Custom code.
Bob
Attached.
{pdf_link} seems to be NULL
{pdf_link} seems to be NULL
Hi santosh,
You haven't corrected the typo in $form->files as far as I can see.
Bob
You haven't corrected the typo in $form->files as far as I can see.
Bob
Corrected. But still no results.
Sorry. That was wrong screenshot.
It is done, without results.
Latest screenshot is here.
It is done, without results.
Latest screenshot is here.
The code now
But still no results
<?php
$form‐>data['pdf_link'] = "<a href='{$form->
files['cf_pdf_file']['link']' >Click here</a>";
?>
But still no results
Hi santosh,
If you copied and pasted the code there is an extra line-break and a missing }
What do you see in the debugger output?
Bob
If you copied and pasted the code there is an extra line-break and a missing }
What do you see in the debugger output?
Bob
Thanks.
It worked. Now I got the link in the email.
But the link is relative & not absolute. Hence not working.
In debugger output, I got
[pdf_link] => <a href='/home2/samarths/public_html/components/com_chronoforms5/chronoforms/pdfs/feedback-form1/pdf-test_20151213003243.pdf' >Click here</a>
A screenshot of debugger output is attached.
Regards
It worked. Now I got the link in the email.
But the link is relative & not absolute. Hence not working.
In debugger output, I got
[pdf_link] => <a href='/home2/samarths/public_html/components/com_chronoforms5/chronoforms/pdfs/feedback-form1/pdf-test_20151213003243.pdf' >Click here</a>
A screenshot of debugger output is attached.
Regards
Hi santosh,
Please download the TCPDF action from the site and reinstall it using the Install action icon in the Forms Manager toolbar. There was a bug in some versions that put the 'path' in the 'link' entry, I think that Max has fixed that in the current version.
Sorry I didn't notice that before.
Bob
Please download the TCPDF action from the site and reinstall it using the Install action icon in the Forms Manager toolbar. There was a bug in some versions that put the 'path' in the 'link' entry, I think that Max has fixed that in the current version.
Sorry I didn't notice that before.
Bob
Not working after reinstall.
My previous file was unloaded from the site on 10th Dec. Hence I expect that the bug is still there in the file.
Any way, that is not my prime requirement. I will wait till the bug is removed.
Thank you for your prompt help.
Regards
My previous file was unloaded from the site on 10th Dec. Hence I expect that the bug is still there in the file.
Any way, that is not my prime requirement. I will wait till the bug is removed.
Thank you for your prompt help.
Regards
I just installed the most recent version of the action, and the bug still exists in the link output - it's still doing the path. How can I fix this?
Hi lydianp18,
You can use a Custom Code action after the TCPDF action like this
Or you can edit the /administrator/components/com_chronoforms5/chronoforms/actions/tcpdf/tcpdf.php about line 178 to be like this
Bob
You can use a Custom Code action after the TCPDF action like this
<?php
$temp = $form->files['cf_pdf_file']['link'];
$temp = str_replace(JPATH_SITE, JUri::root(), $temp);
$temp = str_replace('//', '/', $temp);
$form->files['cf_pdf_file']['link'] = $temp;
?>
Or you can edit the /administrator/components/com_chronoforms5/chronoforms/actions/tcpdf/tcpdf.php about line 178 to be like this
if(strlen(trim($config->get('pdf_post_name', ''))) > 0){
$form->files[trim($config->get('pdf_post_name', ''))] = array('name' => $PDF_file_name.".pdf", 'path' => $PDF_file_path, 'size' => 0);
$form->files[trim($config->get('pdf_post_name', ''))]['link'] = str_replace(array(\GCore\C::get('GCORE_FRONT_PATH'), DS), array($site_link, "/"), $upload_path.$PDF_file_name.".pdf");
$form->data[trim($config->get('pdf_post_name', ''))] = $PDF_file_name.".pdf";
$form->debug[$action_id][self::$title][] = $PDF_file_path.' has been saved correctly.';
}
The third line here should be different from the one you have.
Bob
Hi There,
Could I add TCPDF form link to BOTH email & Thank you message at the same time?
Kate_ee
Could I add TCPDF form link to BOTH email & Thank you message at the same time?
Kate_ee
This topic is locked and no more replies can be posted.