MODX Community

Formit Auto-Reply with Attachment

I am trying to have a form, one of two on the page, to autoreply a thank you email to the users that also has a file attached. Now it will not send an email to the admin or the user. The form information is saved in formit though. It’s mostly a cut and paste from other forms without autoreply emails, so I am confused as to why it is not working. Does anyone have an idea what I got wrong? I have checked my spam inboxes.

[[!FormIt?
   &hooks=`spam,FormItSaveForm,email,FormItAutoResponder,redirect`
   &validate=`nospam:blank,email:email:required`
   &formFields=`email`
   &formEncrypt=`1`
   &emailTpl=`ModalEmailTpl`
   &emailSubject=`eBook Contact`
   &emailToName=`Company Name`
   &emailFromName=`Company Website`
   &emailFrom=`donotreply@email.com.com`
   &emailTo=`info@email.com`
   &redirectTo=`38`
   &formName=`Modal Form`
   &submitVar=`modalsubmit`
   &fiarTpl=`ModalForwardTpl`
   &fiarSubject=`Your Activate Body eBook`
   &fiarFromName=`The Team`
   &fiarReplyTo=`info@email.com`
   &fiarReplyToName=`The Team`
   &fiarToField=`email`
   &fiarFiles=`documents/ebook.pdf`
]]


<form id="modalform" method="post" action="[[~[[*id]]]]" name="modal-form">
	<input type="hidde	n" name="nospam" value="">
	<div class="form-group">
    	<div class="input-group mb-2">
            <div class="input-group-prepend">
                <div class="input-group-text"><i class="fa fa-envelope text-info"></i></div>
            </div>
            <label for="email" class="sr-only">Email address</label>
			<input type="email" class="form-control" id="email" name="email" placeholder="Email" value="[[!+fi.Email]]" required >
        </div>
    </div>
	<input type="submit" value="Get Your Copy!" class="btn btn-success btn-md text-center modal-btn" name="modalsubmit">
</form>

UPDATE: Now it seems no emails are coming from the site, despite having been working prior. I commented out this form and my primary contact form is still not sending email ether.

Hoi

Check all you’re " ` " , check all the names where email goes, I hope .com.com is a mistake. Then input “hidde n” i hope is also mistake.

Good luck with checking

I just figured out that the host shut down email service due to someone getting into our modx install. I had fixed it and added Google authentication for login, but they never contacted me about the suspension so I didn’t know it had been doing that.

I now receive the emails to the admin@ address, but the user does not receive their’s with the attachment. I made a few changes, the donotreply@ is not a real email, but the admin@ is, if that is in any way relevant. Is the file path done correctly? I did that from the base path not assets. Thanks!

EDIT: Turns out the snippet/hook FormItAutoResponder isn’t installed with the Formit installation. Is this no longer an option?

[[!FormIt?
   &hooks=`spam,FormItSaveForm,email,FormItAutoResponder,redirect`
   &validate=`nospam:blank,email:email:required`
   &formFields=`email`
   &formEncrypt=`1`
   &emailTpl=`ModalEmailTpl`
   &emailSubject=``
   &emailToName=``
   &emailFromName=``
   &emailFrom=`donotreply@url.com`
   &emailTo=`admin@url.com`
   &redirectTo=`38`
   &formName=`Modal Form`
   &submitVar=`modalsubmit`
   
   &fiarTpl=`ModalForwardTpl`
   &fiarSubject=``
   &fiarFromName=``
   fiarSender=`donotreply@url.com`
   &fiarReplyTo=`info@url.com`
   &fiarReplyToName=``
   &fiarToField=`email`
   &fiarFiles=`documents/ebook.pdf`
]]

Missing a & for fiarSender could be a problem?

I saw that, no it didn’t fix the issue.

Ok so it was the lack of a &fiarFrom AND a really odd DMARC record that was the issue. I didn’t realize that till I got a slew of notifications of failed sent emails this morning. Changed up the DMARC, added the &fiarFrom to a non-existant email address, and it works!