Forums

Attach uploads to email via db read.

alxben 12 Nov, 2014
Hello,

I am trying to attach uploaded files to an email. I have one form that contains the file upload (images below):

[attachment=0]form_data_array.PNG[/attachment]
[attachment=3]form_debug.PNG[/attachment]

and another form with a db read that loads data based on a condition.

[attachment=2]email_array.PNG[/attachment]
[attachment=1]email_debug.PNG[/attachment]

How can I get the [upload] files to attach to the email. Any help is appreciated.

Alex B.
GreyHead 13 Nov, 2014
Hi Alex,

Please try putting upload in the Attachments box of the Email action. You also need to have the Upload Files action before the Email action.
Bob
alxben 13 Nov, 2014
Hello Bob,

Thank you for your reply. I have entered upload in the Attachments box (still no change) but I do not have an Upload files action on the second form. I am just pulling the information via a db read with a condition that queries that database by a date column. Do I need to add this action in order to accomplish this?

Form 1 - User uploads file(s). (Contains Upload Files action and No email action)
Form 2 - User queries database (db read) and sends email with any attachments. (Does not contain Upload Files action).

Since this is for an Intranet I'm starting to wonder if it would be best to just create links instead of actually attaching the files. Would that task be less difficult with this scenario?

Again Thank you,
Alex
alxben 14 Nov, 2014
Hello,

I have create links to the files that are included in the email

<?php
     foreach ($form->data['Data'] as $d) {
          echo "<tr>
                    <td><a href='.../pd2/components/com_chronoforms5/chronoforms/uploads/my_upload_folder/{$d['upload']}' >File Link</a></td>
                </tr>";
}
?>
</table>


(and working) but my superiors would like to have the option to send an attachment in case the Officer needs to send a report to one of our Commissioners that are located outside our network. So any help would really save me the time of hearing the ridiculous speech that I will have to endure (from my non-technical superiors 😉 ) if I cannot accomplish this.

Thank you,
Alex
GreyHead 15 Nov, 2014
Hi Alex'

Please see this FAQ I think that will do what you need.

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