We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26435
    • 1,193 Posts
    How do I change the from no-reply@{$server_name} to from [the "your email address" text entry in my form] so that when I get the email, instead of saying it is from no-reply, it says it is from the email address the person filling out the form put in?

    -sD-
      Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
      All of the above... in no specific order.


      I send pointless little messages
      • 1764
      • 680 Posts
      There’s no built-in way to do this for the data emails, you can set it for the auto-reply emails by feeding the snippet a confirmation_email_from value

      [!FormProcessor? &confirmation_email_from=`your_email@your_domain.com`!]


      If you’d like to hack the snippet to get this to happen it shouldn’t be too difficult.

      Just search for this line
      $from = "{$modx->config['site_name']}<no-reply@{$server_name}>";


      and change it to
      $from = "{$form['first_name']} {$form['last_name']}<{$form['email']}>";


      That should do it, just make sure to replace first_name, last_name, and email with the names you are using in the actual form. for instance, this would work on a form like this.

      <form>
      <label>First Name</label><input name="first_name">
      <label>Last Name</label><input name="last_name">
      <label>Email</label><input name="email">
      </form>
      
        • 15413
        • 26 Posts
        Hi there,

        I have a strange problem with your FormProcessor-snippet... it´s the first time I used something where I had to add propoerties zu a snippet.

        After I figured out that I simply have to copy all propoerties from the commented-part of the snippet in one one string and just paste it into the "default properties" input field I thought everything is fine:



        But as soon as I save the snippet and open it again, half of the snippet properties are lost:



        The paramter-string I used was:
        &form_chunk=Form Chunk Name;string;&form_required=Form Required Fields;string;&data_email_address=Data Email Address;string;&data_email_subject=Data Email Subject;string;&data_email_chunk=Data Email Chunk Name;string;&confirmation_page_chunk=Confirmation Page Chunk Name;string;&confirmation_email_from=Confirmation Email From Name;string;&confirmation_email_subject=Confirmation Email Subject;string;&write_database=Save in Database;int;1


        Where have all the properties gone? Has somebody an idea what I did wrong?

        Regards,
        Karsten
          My last Modx-Try: http://dhbblog.zendezentrale.com
          My very personal Modx-Playground: http://www.pornocops.com
          (under construction at any time wink )
          • 13577
          • 302 Posts
          There is a 255 character limit to the snippet parameters list. I hit this same wall with a snippet I wrote (to do something very similar ironically). you might check to see if your string is being truncated at 255.
            Standard Disclaimer
            I could be totally wrong.
            • 1764
            • 680 Posts
            The problem is that the property field has a 255 character limit and will cut off anything over that, we’ll make sure to get that bumped up for the next release.

            I created a bug report for this.

            There are a couple of ways to solve this:

            1. You could change the properties field in the site_snippets table from a varchar(255) to a text data type.

            2. You can feed any of these properties to the snippet directly instead of using the properties tab. For example:
            [!FormProcessor? &form_chunk=`my_chunk_name` &data_email_address=`[email protected]` &write_database=`1` !]


            Update:
            Looks like Jared beat me too it. Well here’s the info to get around the 255 limit anyway.
              • 25663 MODX Staff
              • 12,272 Posts
              Quick, to the bugtracker, Batman!
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Bats use sonar to track bugs. grin
                  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
                  • 15413
                  • 26 Posts
                  Quote from: aNoble at Feb 03, 2006, 07:23 AM

                  The problem is that the property field has a 255 character limit and will cut off anything over that, we’ll make sure to get that bumped up for the next release.

                  Update:
                  Looks like Jared beat me too it. Well here’s the info to get around the 255 limit anyway.

                  Thanks a lot both smiley
                  Why the hack hadn´t I thought of it smiley

                  Everything working fine again smiley
                    My last Modx-Try: http://dhbblog.zendezentrale.com
                    My very personal Modx-Playground: http://www.pornocops.com
                    (under construction at any time wink )
                    • 6726
                    • 7,075 Posts
                    Quote from: karsten at Feb 03, 2006, 06:57 AM
                    I have a strange problem with your FormProcessor-snippet... it´s the first time I used something where I had to add propoerties zu a snippet.

                    Am I the only one to notice that the captures are those of a Module not a snippet ?
                    Karsten, did you copy-paste the snippet’s code into a Module huh
                      .: COO - Commerce Guys - Community Driven Innovation :.


                      MODx est l&#39;outil id
                      • 15413
                      • 26 Posts
                      Quote from: davidm at Feb 06, 2006, 04:22 AM

                      Am I the only one to notice that the captures are those of a Module not a snippet ?
                      Karsten, did you copy-paste the snippet’s code into a Module huh

                      Hmm.. nope smiley like you can see here...



                      ...it´s all about a snippet...

                      Or did I get something wrong?

                      Best regards,
                      Karsten


                        My last Modx-Try: http://dhbblog.zendezentrale.com
                        My very personal Modx-Playground: http://www.pornocops.com
                        (under construction at any time wink )

                      This discussion is closed to further replies. Keep calm and carry on.