TCPDF - link to pdf file in thanks message

Le Pache 26 May, 2016
Hi,
I would like to have a link to my pdf file into the thanks message.
So, I have put a custom code before the email action with this
<?php
    $form->data['pdf_link'] = "<a href='{$form->files['my_pdf_file']['link']}' >Click here</a>";
    ?>

The debugger returns this :
Array
(
    [my_pdf_file] => Array
        (
            [name] => animation_20160526111419.pdf
            [path] => /MY_PATH/components/com_chronoforms5/chronoforms/pdfs/renseignements-animation/animation_20160526111419.pdf
            [size] => 0
            [link] => http://MY_DOMAIN/components/com_chronoforms5/chronoforms/pdfs/renseignements-animation/animation_20160526111419.pdf
        )

)


I thought I had just to put {pdf_link} into the content of thanks message... But the message just displays {pdf_link} and not the link...

What I have missed ?
Thanks in advance for reply
GreyHead 26 May, 2016
Hi Le Pache,

That all looks OK, Is the TCPDF action before the Custom Code action?

Bob
Le Pache 26 May, 2016
Yes, Bob, it is.
Here is the content message :
<p>Merci</p>
<p>Télécharger ici {pdf_link}</p>
GreyHead 26 May, 2016
Hi Le Pache,

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

Bob
GreyHead 26 May, 2016
1 Likes
Hi Le Pache,

Fixed I think, this was on odd one that I haven't seen before.

In the custom code you have $form->data but the dash in there was a Unicode Hyphen character instead of a plain ordinary dash so it broke the PHP. They look identical so it's not obvious to see until you start debugging.

Bob
Le Pache 27 May, 2016
Answer
Hi Bob,
You are a champ !
It is running now.
Perhaps it would be good for others to correct this post : https://www.chronoengine.com/forums/posts/f5/t100999.html because i have done a copy-paste of your code there.
Thanks for all again !
Marion
GreyHead 27 May, 2016
Hi Marion,

Thanks - I checked the code in the other post and that is OK - all very odd.

Bob
This topic is locked and no more replies can be posted.