I need assistance with my form - when the form is submitted the form will be a pdf attachment or file attachment on the email instead of in the email text. i am a beginner at this.
Can you please help me with this? & When is the new release of Chronoforms coming?
Can you please help me with this? & When is the new release of Chronoforms coming?
Hi cibblou,
I'm not sure how to get the results as an attachment. There have been a couple of threads about this in the past. I vaguely remember that the last poster managed to solve it but I'm not sure.
Next release is in a few days.
Bob
I'm not sure how to get the results as an attachment. There have been a couple of threads about this in the past. I vaguely remember that the last poster managed to solve it but I'm not sure.
Next release is in a few days.
Bob
Hi cibblou,
"file attachment" of which type ?
as long as you can create a file on the server with the results and feed the attachments array with its path then you can attach it to the email!
Regards
Max
"file attachment" of which type ?
as long as you can create a file on the server with the results and feed the attachments array with its path then you can attach it to the email!
Regards
Max
Max,
As per our emails last week, we discussed coding to make the form email as text file attachment & not in the email content. Which is easier - form to generate PDF or text file? What coding is needed to do this?
As per our emails last week, we discussed coding to make the form email as text file attachment & not in the email content. Which is easier - form to generate PDF or text file? What coding is needed to do this?
Hi cibblou,
try this:
in the onSubmit code box!
Regards
Max
try this:
jimport('joomla.utilities.error');
jimport('joomla.filesystem.file');
$MyForm =& CFChronoForm::getInstance('form_name_here');
$MyFormEmails =& CFEMails::getInstance($MyForm->formrow->id);
$MyUploads =& CFUploads::getInstance($MyForm->formrow->id);
if(!JFile::write(JPATH_SITE.DS.'components'.DS.'com_chronocontact'.DS.'uploads'.DS.$MyForm->formrow->name.DS.'data.txt', 'Some text')){
JError::raiseWarning(100, 'Couldn\'t create upload directroy 2');
}else{
$MyUploads->attachments[] = JPATH_SITE.DS.'components'.DS.'com_chronocontact'.DS.'uploads'.DS.$MyForm->formrow->name.DS.'data.txt';
}
in the onSubmit code box!
Regards
Max
hi Max,
I tried the code in the onsubmit code box - but when i received the email all the form questions & answers were still in the text of the email not as a attachment to the email.
I tried the code in the onsubmit code box - but when i received the email all the form questions & answers were still in the text of the email not as a attachment to the email.
did you get any attachments ? do you see the text "some text" in the email ? did you get any errors after the form is submitted assuming that you have no redirect URL ?
Max
Max
Greets Max, don't know where cibblou is but I tried it. I put the code in the box. When I hit submit the page shows the code i put in that box. The email received has only the file I uploaded and there is no data.txt.
I reckon what that piece of code is trying to do is to write a file data.txt and then attach it to the array to send out? Did it work for you when you wrote it?
Mori
I reckon what that piece of code is trying to do is to write a file data.txt and then attach it to the array to send out? Did it work for you when you wrote it?
Mori
did you get any attachments ? do you see the text "some text" in the email ? did you get any errors after the form is submitted assuming that you have no redirect URL ?
Max
I checked this code. It works. I recieve "some data.txt" with "some text" in it.
Thanks deaddy64 for confirming!
@Mori, make sure you added the form name in the correct place in the code and included the code between 2 PHP tags <?php ?> and added it in the onsubmit code box!
Cheers
Max
@Mori, make sure you added the form name in the correct place in the code and included the code between 2 PHP tags <?php ?> and added it in the onsubmit code box!
Cheers
Max
I added this code to my On submit Before sending email, and it appears to have made no difference. I received my email. The file was listed in the email (and uploaded to my server), but it wasn't attached.
Here's the code I used:
Thanks!
Here's the code I used:
<?php ?>
jimport('joomla.utilities.error');
jimport('joomla.filesystem.file');
$MyForm =& CFChronoForm::getInstance('JGsubmissionform');
$MyFormEmails =& CFEMails::getInstance($MyForm->formrow->id);
$MyUploads =& CFUploads::getInstance($MyForm->formrow->id);
if(!JFile::write(JPATH_SITE.DS.'components'.DS.'com_chronocontact'.DS.'uploads'.DS.$MyForm->formrow->name.DS.'data.txt', 'Some text')){
JError::raiseWarning(100, 'Couldn\'t create upload directroy 2');
}else{
$MyUploads->attachments[] = JPATH_SITE.DS.'components'.DS.'com_chronocontact'.DS.'uploads'.DS.$MyForm->formrow->name.DS.'data.txt';
}
<?php ?>Thanks!
jupitergardens
<?php ?> - it isn't right!
You must use construction:
<?php
*******
?>
And try to attach an existing file.
<?php ?> - it isn't right!
You must use construction:
<?php
*******
?>
And try to attach an existing file.
I'm pretty new to coding. My file field is file_8. How would I attach an existing file?
Thanks!
Thanks!
Hi jupitergardens,
if your form has file field then you don't need any code to get the file attached to the email, you need to configure the uploads, please check the file upload tutorial from the tutorials page!
Regards
Max
if your form has file field then you don't need any code to get the file attached to the email, you need to configure the uploads, please check the file upload tutorial from the tutorials page!
Regards
Max
Okay, because my uploads work just fine. Did I get confused? I thought this script would take the file and also attach it to an email.
Thanks!!!!!
Thanks!!!!!
:oops: I'm sorry but since now it's not work.๐ I pasted this example again. The file created but not attached. $_FILES Array is empty. What can I do to make it work well? ๐คจ Must I switch on Upload in my form settings?
Hi deaddy64,
Yes and add the settings to control the uploads - please get the File Uploads tutorial from the Tutorials link above.
Bob
Must I switch on Upload in my form settings?
Yes and add the settings to control the uploads - please get the File Uploads tutorial from the Tutorials link above.
Bob
Okay, because my uploads work just fine. Did I get confused? I thought this script would take the file and also attach it to an email.
Thanks!!!!!
Hi jupitergardens,
Do you have a form which uploads the file and attach it to the email ? if so then all is fine for you, ignore this!๐
Hi deaddy64,
the $_FILES array should be empty, we are not uploading a file, we are creating a file on server and attaching it to the email, what are you trying to do exactly and I will tell you my thoughts ?
Cheers
Max
I'm creating an excel document (.xls file) with PHPExcel before sending mail and trying to attach it. It works for a short time when i was testing it. After that I changed somthing in my form. And now it doesn't work.
Hi deaddy64,
Test with an Excel file that you are sure is OK and in the correct folder. Turn on DeBug for your form and you should see the $attachments array at the end of the dummy email. DeBug until the attachment is good, then retest with PHPExcel to make sure that the two parts are working together.
Bob
Test with an Excel file that you are sure is OK and in the correct folder. Turn on DeBug for your form and you should see the $attachments array at the end of the dummy email. DeBug until the attachment is good, then retest with PHPExcel to make sure that the two parts are working together.
Bob
Hi deaddy64,
have you tried Bob's suggestion ? you will need this code piece and you will need to add the file data.xsl at the path shown below:
have you tried Bob's suggestion ? you will need this code piece and you will need to add the file data.xsl at the path shown below:
$MyForm =& CFChronoForm::getInstance('JGsubmissionform');
$MyFormEmails =& CFEMails::getInstance($MyForm->formrow->id);
$MyUploads =& CFUploads::getInstance($MyForm->formrow->id);
$MyUploads->attachments[] = JPATH_SITE.DS.'components'.DS.'com_chronocontact'.DS.'uploads'.DS.$MyForm->formrow->name.DS.'data.xsl';
Hi all again. I solved my problem.lightbulb I checked settings in "Setup Email" -> "Enable attachments" it was "Yes". I reseted it (set "no", then "yes"). After these manipulations my form works well. Thank you all!
Thanks for posting about this, so all is working fine now ?๐
Regards,
Max
Regards,
Max
Hi cibblou,
try this:
jimport('joomla.utilities.error');
jimport('joomla.filesystem.file');
$MyForm =& CFChronoForm::getInstance('form_name_here');
$MyFormEmails =& CFEMails::getInstance($MyForm->formrow->id);
$MyUploads =& CFUploads::getInstance($MyForm->formrow->id);
if(!JFile::write(JPATH_SITE.DS.'components'.DS.'com_chronocontact'.DS.'uploads'.DS.$MyForm->formrow->name.DS.'data.txt', 'Some text')){
JError::raiseWarning(100, 'Couldn\'t create upload directroy 2');
}else{
$MyUploads->attachments[] = JPATH_SITE.DS.'components'.DS.'com_chronocontact'.DS.'uploads'.DS.$MyForm->formrow->name.DS.'data.txt';
}
in the onSubmit code box!
Regards
Max
Hi GH, Max...
Sorry to bring this thread back up.
Because this is almost exactly what I need! ^__^
But instead of txt file, i need the attachment to be in PDF. And in that PDF is my fields listed.
Can you guys help me with this one?
I can also live if the attachment is txt file.
How to change the example 'Some Text' with my fields?
Uh i'm so close... i think.
Been spending few days in the forum trying to find how to.
Thanks!
Oh and I willing to pay for this code.
Should i post a thread on professional room?
Should i post a thread on professional room?
Hi diva,
I've been looking for the last day to two at using PhocaPDF with ChronoForms - it looks as though it could be ideal for this. But it needs a custom plugin written and the documentation is zero - still I'm making some progress and have a request in to Jan for a little guidance.
Bob
I've been looking for the last day to two at using PhocaPDF with ChronoForms - it looks as though it could be ideal for this. But it needs a custom plugin written and the documentation is zero - still I'm making some progress and have a request in to Jan for a little guidance.
Bob
This topic is locked and no more replies can be posted.
