We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36551
    • 416 Posts
    I'm unable to change the reply-to address in the cc email sent to the submitter of a form.

    The form is going to all the right people in the client organization and a cc is being sent to the submitter. The sitename is appearing correctly in the from field in the cc email but my personal email address is appearing in the reply to in that email.

    I sent a test using [email protected] as the submitter of the form. The cc note I received has [email protected] in the reply-to.

    from: Site name <[email protected]>
    reply-to: [email protected]
    to: [email protected]
    date: Thu, May 29, 2014 at 2:59 PM

    I don't understand where this reply-to address is coming from. Here's my formit call (names changed). My address is no where in the call.

    [[!FormIt?
    &hooks=`spam,email,redirect,FormItAutoResponder`
    &emailTpl=`emailsendto`
    &fiarTpl=`emailcc`
    &fiarToField=`email`
    &fiarFrom=`[email protected]`
    &fiarFromName=`[[++site_name]]`
    &fiarReplyTo=`[email protected],[email protected],[email protected]`
    &emailReplyTo=`[email protected],[email protected],[email protected]`
    &fiar=`[[++site_name]]`
    &fiarSubject=`Subject - Contact Form`
    &emailTo=`[email protected]`
    &emailUseFieldForSubject=`1`
    &redirectTo=`16`

    &validate=`nospam:blank, firstname:required, lastname:required, email:email:required, text:required:stripTags`
    &submitVar=`contactformsubmit`
    ]]

    Where is that reply-to coming from? What am I missing?

    Modx 2.2.14
    Formit 2.2.0
    Site is installed on the client's in-house server.
    • Is your email address the system default, as set in the 'emailsender' setting in System Settings?
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 36551
        • 416 Posts
        Hi Susan

        One of the first things I checked. No. A client email address is in that field.
        • It's possible that the emailReplyTo property can only accept a single address, and it's using the submitter's email as a default when it finds an invalid value?
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 36551
            • 416 Posts
            Actually I used [email protected] as the submitter email address which is different than the reply-to address that appears on the notes.

            However, I did run a quick test with a single address in the both the emailReplyTo and &fiarReplyTo parameters. No change. That was a good idea.

            emailReplyTo is working correctly--this address does appear in the email as the reply to.

            It's the &fiarReplyTo that is not working.

            RTFM says &fiarReplyTo is a required field and no default value is specified. However, if I exclude the parameter entirely, the message is delivered and my email address still appears.

            What about this?

            Modx was installed on the client server by their IT folks. We had problems initially with file permissions. Is it possible that there is still some permission problem somewhere? It seems unlikely to me, since all the other parameters are working as expected.

            Or how about this? Formit and related Chunks were installed via Packman. The source installation did have my email address specified in those chunks. But this too seems like a stretch that this could be related.

              • 3749
              • 24,544 Posts
              I don't see how it could be a permission issue.

              The code is fairly straightforward:

              $emailReplyTo = $this->modx->getOption('emailReplyTo',$this->formit->config,$emailFrom);


              If the &emailReplyTo property is set, it's used. If not, it defaults to the &emailFrom property.

              There is also an &emailFromName property that you're not using. Adding it couldn't hurt.

              I'd take a close look at the Tpl chunks to see if maybe your address is hard-coded somewhere or if the wrong placeholder is being used.

              I'd also delete all the files in the core/cache directory to make sure the cache is fully cleared.
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 36551
                • 416 Posts
                Hi Bob

                The cache has been cleared numerous times for a variety of other reasons since this began.

                Here's the emailcc tpl specified with this:

                &fiarTpl=`emailcc`

                [[+firstname]]<br >
                
                <p>This is the information you sent using the contact form on our website.</p> 
                <br />[[+firstname]] [[+lastname]]<br />
                <p>Your email: [[+email]]</p> 
                <p>Your phone #: [[+phone]]</p> 
                <p>Your message:</p>
                [[+text]]


                Nothing hard coded.

                My email address is appearing in the email header after the site name.

                from: Site name <[email protected]>
                reply-to: [email protected]
                to: [email protected]
                date: Thu, May 29, 2014 at 2:59 PM

                I don't think the tpl can populate that field, right?

                The site name is being correctly populated with:

                &fiarFromName=`[[++site_name]]`

                My email address immediately follows it and appears on the reply-to.

                I'd be happy to let someone in to look around.
                  • 3749
                  • 24,544 Posts
                  FormIt AutoResponder.

                  Here is the relevant code from line 85 of the FormItAutoresponder snippet:

                  $emailReplyTo = $modx->getOption('fiarReplyTo',$scriptProperties,$mailFrom);


                  It defaults to the emailFrom address. It looks like for some reason the &fiarReplyTo property is not getting through, though the result doesn't seem to match the &emailFrom value either.

                  This is a good example for why I never use FormIt. wink
                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting
                    • 36551
                    • 416 Posts
                    Bob

                    I just had another client call me where this problem was happening. In that case, my email was in the system settings. When I updated the setting, the reply-to changed to the new address, as you suggested it should.

                    I'm thinking I may uninstall FormIt, clear out the cache etc. Then reinstall it.

                    I'm grasping at straws here.
                      • 3749
                      • 24,544 Posts
                      Do you mean the emailsender System Setting? That was my first suspicion, though how that would get into the fiarReplyTo field is still a mystery.
                        Did I help you? Buy me a beer
                        Get my Book: MODX:The Official Guide
                        MODX info for everyone: http://bobsguides.com/modx.html
                        My MODX Extras
                        Bob's Guides is now hosted at A2 MODX Hosting