We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13986
    • 90 Posts
    Is there anyway to get eform to put the form sender’s email address in the replyto field?

    Al the forms on my website require a email address from the sender. It would be good if when I get the email, I could just hit "Reply" in my email program and then the users email address would be in the to field automatically. Currently I have to copy the email address from the form result and paste it in the to field.

    We have about 10 forms on our website, that get about 20 times a day and they have to all be responded to, so this would be a big time saver for us.
      Jeremy Foster
      • 16545
      • 358 Posts
      U must to use &replyto=`email`,
      RTFM
        • 13986
        • 90 Posts
        I am using that and I did search the manual. I still get the "from" address as the user that will be sent to when I hit reply.

        Maybe it’s my email software? I thought maybe I misunderstood what the replyto parameter was doing.
          Jeremy Foster
          • 13986
          • 90 Posts
          Just checking the email headers that come with the form submission:
          ------------------------------
          From: [email protected]
          Reply-to: [email protected]
          ------------------------------

          Yet when I click the "reply" button in my email software, it sets the "To" field of the email to "[email protected]" instead of "[email protected]". I’m using Novel Groupwise email system.
            Jeremy Foster
            • 13986
            • 90 Posts
            I now know what the problem is but I don’t know how to fix it.

            It seems if the eform paramater is set "to" "[email protected]" and the "from" "[email protected]" and the "replyto" parameter is set to "email" (form input field).
            Then to test the form I fill the email input as "[email protected]".

            When I get the email in my inbox and hit reply it will put "[email protected]" in the "to" field of the email.

            If I go back and test the form again, but this time enter "[email protected]" then when I get the message and hit reply in my email program it puts "[email protected]" in the "to" field.

            So it would seem the email system (Novel Groupwise) is having an issue when the users’ email address matches the "to" field in the email header.

            Shouldn’t be a huge problem... but there are many at our company that use their own email addresses when filling out our forms.
              Jeremy Foster
              • 16545
              • 358 Posts
              Show your eform queue and eform tpl chunk. Maybe we’ll find your mistake.
                • 13986
                • 90 Posts
                Thanks, but it was a problem with Groupwise not eform.

                On the other side of this, I have now modified eform so that it shows the email of the user in the "from" section of the sent email.

                			
                if(!strstr($from,'@'))
                	$from = ( $fields[$from] && strstr($fields[$from],'@') )?$fields[$from]:$from;
                
                  Jeremy Foster
                  • 29076
                  • 615 Posts
                  Quote from: jeremy at Mar 16, 2009, 11:36 AM

                  On the other side of this, I have now modified eform so that it shows the email of the user in the "from" section of the sent email.

                  			
                  if(!strstr($from,'@'))
                  	$from = ( $fields[$from] && strstr($fields[$from],'@') )?$fields[$from]:$from;
                  

                  Just to get things accurate; I have a standard contact form where the sender (a user from "outside", not logged in as a user i modx backend) have to put in his/hers email address i an email address field. In the received email from that user I have the same information as you mentioned (I use Google mail):
                  ------------------------------
                  From: [email protected] (this is the email address set in the site settings in the modx backend)
                  Reply-to: [email protected] (this is the address the user putted in to the email field in the contact form)
                  ------------------------------

                  As far as I understand your solution I should get the Reply-to address in the To field when I hit Answer. I tried (Line 430 in eform.inc.php in eForm 1.4.4.5), but I still get the From address in the To field. Is there something else I should change or is your solution related to Groupwise?

                  Thanks.
                    I think, thererfor I am! But what I am, and why...?
                    • 10313
                    • 375 Posts
                    The modified code by jeremy allows to use a form field name as value for "from". If your user fills in his email into a field named "email", you can set
                    &from=`email`
                    to have the sender set to the filled in email adress.

                    But: for me on my server (some Unix), this does not work. It is prohibited to give an arbitrary sender name.

                    But (2): for me, the standard way works very good. I set
                    &replyto=`email`
                    . After I receive the form report (sent as text) and I hit "reply" in Thunderbird, the reply will be sent to the one who originally filled out the form. That’s just like expected smiley

                    Martin
                      • 37242 ☆ A M B ☆
                      • 339 Posts
                      The last 5 hours I’ve been working on that problem. laugh *happy, happy, happy*

                      My results:
                      [!eForm? ... &subject=`Nachricht von [+name+] eingetroffen` ... &replyto=`[+email+]` !]

                      Does nothing. Email "Replyto" still is "From".
                      [!eForm? ... &subject=`Nachricht von [+name+] eingetroffen` ... &replyto=`[email protected]` !]

                      "Replyto" is "[email protected]". As not only one person uses my contact form ->bad idea.

                      Setting
                      'replyto' => isset($replyto)? $replyto:'[email protected]',

                      in the eForm snippet while haveing
                      &replyto=`[+email+]`

                      set leads to nothing.

                      Now deleting
                      &replyto=`[+email+]`

                      leads to the result that I want: [email protected] as replyto. Huh?

                      Changing the snippet call to:
                      [!eForm? ... &subject=`Nachricht von [+email+] eingetroffen` ... &replyto=`[+email+]` !]

                      leads to the email adress from the form inside the subject.

                      Putting 1 & 1 together: ’&replyto’ does not get evaluated when containing a fieldname instead of a string.

                      From what i understand, the data goes the following way:

                      • form as email adress in field
                      • snippet call tells snippet, that "replyto" equals the data of the field [+email+]
                      • snippet checks it there is a value for &replyto and if not uses the default value (which one could set)
                      • included eform file gets the whole bunch from snippet and prepares mail
                      • php mailer finally sends it out (except for further mpa)
                      So the snippet call does not pass the value of "&replyto" or the snippet does not take it.