This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

How to use custom_hooks.php


  1. knitzsche
    Member

    I would like to understand how to use custom_hooks.php.

    Thanks

    Posted 16 years ago #
  2. yuniar

    Actually, this is an experimental feature provided to customize some behaviour of MachForm. That's why there is no documentation about this.

    So far, it's being used to send autoresponder emails to users. Check here for some samples:

    http://www.appnitro.com/forums/topic/how-to-send-a-copy-of-the-form?replies=11
    http://www.appnitro.com/forums/topic/sending-html-email-back-to-submitter?replies=29

    As of version 2.0 (planned to be released next week), all custom hooks functions will be removed. Since those features are already available as built in feature. And due to the complexity of it.

    The only available function in custom hooks would be formXX_hook_pre_captcha which can be used to change the color scheme of your reCaptcha.

    An example hook to modify the captcha color scheme:

    function form2_hook_pre_captcha(){
    		$capthca_theme =<<<EOT
    <script>
    var RecaptchaOptions = {
       theme : 'blackglass'
    };
    </script>
    EOT;
    		return $capthca_theme;
    	}


    That would change the scheme of your captcha to black. Supported themes are 'red', 'white', 'blackglass' and 'clean'.


    MachForm Founder

    Posted 16 years ago #
  3. knitzsche
    Member

    Thanks for the info, Yuniar. Looking forward to the new release.

    Ciao!
    Kalpana

    Posted 16 years ago #

RSS feed for this topic

Reply