I am trying to include in an email links to files that have previously been uploaded on the submit On submit. Everything works correctly, the files are attached perfectly, there are no error messages in the debugger but the email is not sent.
I have tried to include in the email template the following code:
With that code it appears correctly in the debugger but it does not send the email.
This code:
It does absolutely nothing, I imagine that "file79" is an array, and the syntax is not correct.
Can you help me to correct this?
Thank you so much. Best regards.
I have tried to include in the email template the following code:
<?php
foreach ( $form->files['file79'] as $k => $f ) {
$ruta = $form->files['file79'][$k]['path'];
$vinculo = $form->files['file79'][$k]['link'];
echo "<a href=".$vinculo.">".$archivo."</a></br>";
}
?>
With that code it appears correctly in the debugger but it does not send the email.
This code:
<?php echo "<a href='{$form->files['file79']['link']}' >{$form->files['file79']['name']}</a><br/>"; ?>
It does absolutely nothing, I imagine that "file79" is an array, and the syntax is not correct.
Can you help me to correct this?
Thank you so much. Best regards.
Hi jhaviro,
Do you have the WYSIWYG editor enabled in the Email action? That might prevent the PHP from running there. Please try adding the PHP in a Custom Code action before the Email action like this
Bob
Do you have the WYSIWYG editor enabled in the Email action? That might prevent the PHP from running there. Please try adding the PHP in a Custom Code action before the Email action like this
<?php
$file_links = array();
foreach ( $form->files['file79'] as $k => $f ) {
$vinculo= $form->files['file79'][$k]['path'];
$archivo= $form->files['file79'][$k]['link'];
$file_links[] = "<a href='{$vinculo}' >{$archivo}</a>";
}
$form->data['file_links'] = implode('<br />', $file_links);
?>
Then add {file_links} in the email template.
Bob
Hello, now work perfect!!
I just forgot to include the var"$archivo".
Now this is correct:
Thank you so much for your help.
Best regards.
I just forgot to include the var"$archivo".
Now this is correct:
<?php
$file_links = array();
foreach ( $form->files['file79'] as $k => $f ) {
$vinculo = $form->files['file79'][$k]['link'];
$archivo = $form->files['file79'][$k]['name'];
$file_links[] = "<a href='{$vinculo}' >{$archivo}</a>";
}
$form->data['file_links'] = implode('<br />', $file_links);
?>
Thank you so much for your help.
Best regards.
This topic is locked and no more replies can be posted.