Email event + Attach file

gonzalos 25 May, 2013
Hello I would like to ask how to implement in the email event to send a file, which is always the same and is located in the server. I been trying different things but it does not work. I am working in Joomla 3

Thanks!
gonzalos 26 May, 2013
Dear Bob,

The file that I am sending by email is uploaded in the server. I found this tutorial as well http://www.chronoengine.com/faqs/2676-how-can-i-attach-uploaded-files-to-an-email.html

So in the "Attachments fields name" I wrote the name of the file with the full path and the email arrives but it does not come with the file on it.

Also I tried to add in the template something like:

<?php
$files_array = array (
  1 => "/var/www/a.txt"
);
$attach_files = array();
foreach ( $files_array as $k => $v ) {
     $attach_files[] = $v;
}
$form->data['file_array'] = $attach_files;
?>


Also it does not arrive. Any idea of where is the error?

Thank you very much
GreyHead 26 May, 2013
Hi gonzales,

The FAQ says that adding a path will only work if you use my Email [GH] action. Have you installed it?

Bob
gonzalos 26 May, 2013
Hi Bob, while trying to install the ChronoForms v4 action email_gh I am getting the error "
Warning

Warning: Failed to move file!"

The problem must be some permission on some directory. How can I dump the directory name where the problem is happening?

Thanks again!
GreyHead 27 May, 2013
Hi gonzales,

You need to install it using the Install Action icon in the ChronoForms Forms Manager toolbar; you can't use the Joomla! extension installer.

Bob
gonzalos 27 May, 2013
Dear Bob,

I used the Install Action to install it but I am getting the error that I mentioned, I am pretty sure that is because of the permissions, the problem is I cannot find in which directory is installing so I can change the permissions. It just mentioned the error that I said before "Warning.."
In which directory is this pluging going to be install? And there is some tutorial on how to work with this plugin in order to attach files?

Again, Thank you very much
GreyHead 27 May, 2013
Hi gonzales,

It's installed in the administrator/components/com_chronoforms/form_actions folder. You can just copy it over there if that is easier.

The error may happen if you have FTP enabled on your site and the FTP User doesn't have write permissions. Turning FTP off will usually fix this problem.

Bob
gonzalos 27 May, 2013
Dear Bob,

Sorry for so many questions. I copy the folder from my localhost (where it was installed correctly).
But still I cannot send emails with the uploaded file attached, do I have to change some other thing?

Thanks!
GreyHead 27 May, 2013
Hi gonzales,

What exactly doesn't work?

Please drag a Debugger action into the On Submit event, then submit the form and post the debug - including the 'dummy emails' results here.

Note: if you are using the Easy Wizard you can turn on Debug on the Others tab.

Bob
gonzalos 27 May, 2013
Dear Bob,

What is still not working is the attachment on the email sent. The debug result is:
Array
(
    [chronoform] => RecibeTourForm
    [event] => submit
    [email_tour] => info@domain.com
    [enviar] => Enviar
    [send_email] => yes
    [891d7e6b1b92a537b249db0b17e0de92] => 1
    [chronoform_data] => Array
        (
            [cf_uid] => fe942f5fe24fba7b09681370c629819f
            [cf_created] => 2013-05-27 17:42:08
            [cf_created_by] => 0
            [cf_ipaddress] => IPAdds
            [cf_user_id] => 0
            [chronoform] => RecibeForm
            [event] => submit
            [email_tour] => email@domain.com
            [enviar] => Enviar
            [send_email] => yes
            [891d7e6b1b92a537b249db0b17e0de92] => 1
            [id] => 33
        )

    [chronoform_data_id] => 33
    [files_array] => Array
        (
            [0] => /var/www/a.txt
        )

)

Validation Errors:

Array
(
)

Thank you for the email..
Debug Data

    email
        1
            Result An email has been SENT successfully from (Domain)info@domain.com to test@domain.com
            Body

            Test

            Submitted by IP
            Attachments array ( )
        6
            Result An email has been SENT successfully from (Domain)info@domain.com to test@domain.com
            Body

Test


            Submitted by IP
            Attachments array ( )

As you can see the file was not attached.
Where is the problem?

Thank you very much
GreyHead 27 May, 2013
Hi gonzalos,

It doesn't look as though you are using the Email [GH] action??

Bob
gonzalos 27 May, 2013
Bob I am using Email [GH] action. I meant I don't know if it is active and working but i copied the directory into my server under the same name that it was installed on the localhost.

Thanks
GreyHead 27 May, 2013
Hi gonzalos,

. . . and have you added it to your form?

Bob
gonzalos 27 May, 2013
Bob I am not pretty sure of how I have to add it. What i did is I added a hidden field called send_email with the value on YES. Is that what you meant?

Thanks
GreyHead 28 May, 2013
Hi gonzalos,

To add the action you need to open your form in the Form Wizard (not the Easy Form Wizard) and drag the action from the [GH] Custom Actions Group into the form On Submit event. Then you need to configure it.

Bob
gonzalos 28 May, 2013
Bob,

I disable the FTP account and I am still getting the same error. Also I changed the permissions of administrator/components/com_chronoforms/form_actions to 777, and still same error.
I moved the folder to the right path, but the option [GH] Custom actions still does not appear in "Action". Any idea?

By the way, in the localhost works properly, it must be some problem with permissions on the server.

Thanks!
gonzalos 28 May, 2013
Bob I found the solution,

The permissions problem was regarding with this directory /var/www/visitatibet/public_html/administrator/cache/ChronoForms v4 action email_gh.zip

So by changing /cache to 777 solves the problem.

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