MODX Revolution and Formit plugin: not sending mail attachments

744 Views Asked by At

Using MODX Revolution and Formit, I try to attach a file to a contact form. The mail is sent but without the attachment. For some strange reason, I can also no longer find any information on the attachments hook. Has that feature been removed from Formit recently?

[[!FormIt?
   &hooks=`spam,email,attachments,redirect`
   &emailTpl=`sometemplate`
   &emailTo=`[email protected]`
   &emailBCC=`[email protected]`
   &emailSubject=`some subject`
   &redirectTo=`123`
   &validate=`name:required, filedata:required`
]]

<form action="[[~[[*id]]]]" method="post" class="form" enctype="multipart/form-data">
    <input type="text" name="name" id="name" value="[[!+fi.name]]">
    <input id="filedata" name="filedata" type="file" value="[[+fi.filedata]]">
    <button type="submit">SEND</button>
</form>

Again, mail is sent (I tried many different email adresses) but the attachment is always missing. What's wrong?

2

There are 2 best solutions below

0
On

Did you try https://modx.com/extras/package/ajaxupload2 extra?

From description:

With two FormIt hooks the upload queue could be pre filled from a FormIt field
value and be saved into a FormIt field value. With a third FormIt hook the
uploaded files could be attached to the FormIt mails.
0
On

Just leave the hook 'attachements' away, formit handles a file input without that hook.