Auto-Email with multiple attachments

OlliMuc 13 Aug, 2012
Hi,

I've been using a CF on my old J1.5 installation where customers could order an info package with two PDFs. A custom code on submit worked brilliant. I've been trying to use the same code with CF V4 and just can't get it to work - it always yields an HTML 500 error. Any sugestions?

<?php
$MyForm =& CFChronoForm::getInstance('infos');//Replace with Your Form name
$form_id = $MyForm->formrow->id;
$MyUploads =& CFUploads::getInstance($form_id);
$MyUploads->attachments = array();
$MyUploads->attachments[] = JPATH_SITE.DS.'jupgrade'.DS.'images'.DS.'files'.DS.'data1.pdf';
$MyUploads->attachments[] = JPATH_SITE.DS.'jupgrade'.DS.'images'.DS.'files'.DS.'data2.pdf';
?>
GreyHead 13 Aug, 2012
Hi OlliMuc,

The easiest answer is to get my Email [GH] action; that will let you add a list of static file paths in the action configuration.

Bob
OlliMuc 14 Aug, 2012
Dear Bob,

thanks a lot for your answer, that's fantastic! I've installed the plugin and it already sends an Email, but won't include any attachments. Is there an easy fix for this (like, add additional fields / actions to the on submit location), or will I have to post a bug report?
GreyHead 14 Aug, 2012
Hi OlliMuc,

The attachments should be OK. What do you have in the Attachments box of the Email [GH] action?

Bob
OlliMuc 16 Aug, 2012
Dear Bob,

thanks for your reply! I've figured out what went wrong: The {}brackets around #path were missing. Now, everything works like a charm - thank you so much for all your effort!

Ollie
kevreid 04 Dec, 2012
I too am having problems getting my attachments to load in to the email.
I am using the latest version of email [GH] so that I can use static attachments.
i have the following in my attachments entry box
{#path#}/Attachments/OpenDays/Seniors%20Open%201%20A5%20web.pdf,{#path#}/Attachments/OpenDays/Seniors%20Open%202%20A5%20web.pdf,{#path#}/Attachments/OpenDays/Juniors%20Open%20web.pdf,{#path#}/Attachments/OpenDays/Ladies%203%20Ball%20A5%20web.pdf,{#path#}/Attachments/OpenDays/Ladies%204%20Ball%20A5%20web.pdf,{#path#}/Attachments/OpenDays/Mens%20Open%20A5%20web.pdf,{#path#}/Attachments/OpenDays/Mixed%20Open%20A5%20web.pdf,{#path#}/Attachments/OpenDays/Rabbits%20Open%20A5%20web.pdf

I have tried replacing the path with the full path and I have tried with spaces rather than %20 but no difference. I et the emails but no attachments.
I am very new to joomla and even newer to chronoforms so I might need chapter and verse on how to solve this.

Thanks

Kev
kevreid 04 Dec, 2012
here is the debug data which shows no files being loaded.
Data Array:
Array
(
[chronoform] => Open_Day_Application
[event] => submit
[Itemid] => 166
[option] => com_chronoforms
[view] => form
[input_text_1] => [email]me@email.com[/email]
[input_text_2] => add
[input_text_3] => add
[input_text_4] => add
[input_text_5] => post
[input_text_6] => 0
[input_submit_7] => Submit
[7e978e8ca11ddede9636ba3bc2d950cc] => 1
[IPADDRESS] => ip.ip.ip.ip
)
Validation Errors:
Array
(
)
Thank you - your email is on its way to you with your required documents.
GreyHead 04 Dec, 2012
Hi kevreid,

First guess is that the Upload Files action isn't enabled?

Bob
kevreid 05 Dec, 2012
Thanks for your reply,

My files are already on the server - doesn't the upload files action load them from the client side?
i have tried putting the action on the load side of the template but left it un-configured because i dont know what to enter in the locations as I am not uploading any more files.

can you think of anything else or alternatively let me know what needs configuring in the upload files action.

Thanks
Kev
GreyHead 05 Dec, 2012
Hi Kev,

Sorry, there are a couple of posts on file uploads and I didn't read far enough back :-(

Is the file path correct? you have them in an Attachments folder in the site root?

Please post a link to the site (or PM or email it if you prefer) so I can take a quick look.

Bob
GreyHead 06 Dec, 2012
Hi Kev,

I'd expect to be able to see the files from my browser at e.g.
http://your_domain.com/otley/Attachments/OpenDays/Seniors%20Open%201%20A5%20web.pdf
or possibly
http://your_domain.com/Attachments/OpenDays/Seniors%20Open%201%20A5%20web.pdf
but noting is visible for the two or three that I tried.

I suggest that you rename the files to replace the spaces with _ or - e.g. Seniors_Open_1_A5_web.pdf and double check the path where they are stored.

Bob
kevreid 08 Dec, 2012
Strange my web browser showed them. But I removed the space and replaced with _ and all is well.
I thought I had already tried that but must have made an error somewhere.

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