We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40462
    • 9 Posts
    ModX: 2.2.4 PL
    ForrmIt: 2.1.1
    Hosting: JustHost

    [[!FormIt?
       &hooks=`recaptcha,spam,email,redirect`
       &emailTpl=`contact_email`
       &emailTo=`[[++site_email]]`
       &emailSubject=`[[++site_name]] : Contact Form`
       &redirectTo=`39`
       &validate=`name:required,
    	email:email:required,
    	telephone:required,
    	message:required:stripTags`
    ]]


    The problem lies in using a custom system setting for formit ([[++site_email]]). The settings for this system setting are:

    Key: site_email
    Name: Site Email
    Description: The email that forms and other objects should direct to.
    Type: Text Box
    Others: Default

    The issue is that this will not prepopulate the formit email sender ([[++site_email]]), while I have tried emailsender that is used for site registration and it works fine.

    Any thoughts or ideas on why this is? The idea was to make a simple email tie-in that would then update all the forms on the website (there's 4 total). [ed. note: robertr last edited this post 11 years, 7 months ago.]
      • 3749
      • 24,544 Posts
      What is the namespace of the System Setting? It might have to be core or formit.

      You may also have to flush all settings once in order to MODX to see the new setting.


      ------------------------------------------------------------------------------------------
      PLEASE, PLEASE specify the version of MODX you are using.
      MODX info for everyone: http://bobsguides.com/modx.html
        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
        • 40462
        • 9 Posts
        Namespace is currently assigned to 'core'. I will try to make one assigned to formit if possible.

        How do I flush all the settings (assuming its a setting cache, rather than actual settings?)

        Thanks for your help Bob.
          • 3749
          • 24,544 Posts
          It's the "Flush all Settings" option on the "Security" menu (Manager top menu).

          BTW, there is already an emailsender System Setting that might do what you want.



          ------------------------------------------------------------------------------------------
          PLEASE, PLEASE specify the version of MODX you are using.
          MODX info for everyone: http://bobsguides.com/modx.html
            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
            • 42118
            • 6 Posts
            Although it doesn't answer your question, I use chunks rather than a custom system setting to set email addresses for Formit forms. I have found that it is likely that eventually a client will want different forms sent to different email addresses - one to sales, one to customer support and a third form to both!
            So in the Formit call, I use &emailTo=`[[$salesFormAddress]]` in one form, &emailTo=`[[$serviceFormAddress]]` in another etc. This also has the advantage that in your chunk you can have multiple email addresses separated by a comma ([email protected],[email protected]).
            Finally, I'd prefer my clients to be editing email addresses in a chunk (if they really want to - and some of them do) rather than fiddling around with system settings!