We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36687
    • 24 Posts
    I have the following eform callout:
    [!eForm? &formid=`contactusForm` &subject=`Contact_Us from ((email))` &tpl=`eContactUsForm` &report=`eContactUsReport` &to=`[email protected]` &from=`[email protected]` &thankyou=`contactusFormThx` !]

    The problem is that the subject line in the email that is sent is not evaluating the ((email)) placeholder. Instead I literally get "Contact_Us from ((email))" as the subject line. This worked fine in 1.0.15. Anyone know how to fix this?

    This question has been answered by multiple community members. See the first response.

      • 33238
      • 388 Posts
      Try using the old ones [+email+]
        --
        ysanmiguel.com
        • 36687
        • 24 Posts
        ysanmiguel,

        Thanks, but that was the first thing I tried. I'm using the double parentheses because I also use PHx. I've tried updating PHx to the latest version (2.2.0) - no luck. If I disable PHx and use [+email+] it does work so this appears to be an issue with the PHx plugin.
        • discuss.answer
          • 13226
          • 953 Posts
          Everything you can do in PHX you can do with "IF"

          "IF" doesn't screw up things like "PHX" does, I dropped "PHX" ages ago for "IF"

          For more info read this post, you will also find questions from me there

          "IF" is a default snippet, so you should be able to use it if you are running Evo 1.0.15+
            • 36687
            • 24 Posts
            Iusemodx:
            Thanks, I was not aware of the IF snippet. Unfortunately, there does not appear to be much documentation on how this works. I made a test change to one of my templates based on the examples from the post you sited. That worked, but I have several more changes to make before I can turn off PHx. At least I have some direction now to get everything working.
              • 45694
              • 6 Posts
              I encountered the problem too with a ((name)) call in the subject line.
              Seems like the string replacement is not working any more:

              // pixelchutes PHx workaround
              foreach( $_params as $key=>$val ) $params[ $key ] = str_replace( array('((','))'), array('[+','+]'), $val );

              The multiple sites I working with all use phx extensively so a 'simple' replacement with if is not an option.

              Is there anyone out there who knows what code should be changed? [ed. note: purensimple last edited this post 7 years, 9 months ago.]
              • discuss.answer
                • 45694
                • 6 Posts
                And after deep searching I found the problem and solution. Seems like some of the eForm code was altered in evo 1.1 (found a comparison on the internet. After pasting the 10.0.15 Eform snippet code over the new snippet code everything is working like a charm again. So if you need phx and Eform working together in evo 1.1 use the snippet code below for Eform.

                <?php
                if(!defined('MODX_BASE_PATH')){die('What are you doing? Get out of here!');}
                # eForm 1.4.6 - Electronic Form Snippet
                # Original created by Raymond Irving 15-Dec-2004.
                # Version 1.3+ extended by Jelle Jager (TobyL) September 2006
                # -----------------------------------------------------
                # Captcha image support - thanks to Djamoer
                # Multi checkbox, radio, select support - thanks to Djamoer
                # Form Parser and extened validation - by Jelle Jager
                #
                # see eform/docs/eform.htm for history, usage and examples
                #

                # Set Snippet Paths
                $snipFolder = isset($snipFolder)?$snipFolder:'eform';
                $snipPath = $modx->config["base_path"].'assets/snippets/'.$snipFolder.'/';


                # check if inside manager
                if ($modx->isBackend()) {
                return ''; # don't go any further when inside manager
                }

                //tidying up some casing errors in parameters
                if(isset($eformOnValidate)) $eFormOnValidate = $eformOnValidate;
                if(isset($eformOnBeforeMailSent)) $eFormOnBeforeMailSent = $eformOnBeforeMailSent;
                if(isset($eformOnMailSent)) $eFormOnMailSent = $eformOnMailSent;
                if(isset($eformOnValidate)) $eFormOnValidate = $eformOnValidate;
                if(isset($eformOnBeforeFormMerge)) $eFormOnBeforeFormMerge = $eformOnBeforeFormMerge;
                if(isset($eformOnBeforeFormParse)) $eFormOnBeforeFormParse = $eformOnBeforeFormParse;
                //for sottwell smiley
                if(isset($eFormCSS)) $cssStyle = $eFormCSS;

                # Snippet customize settings
                $params = array (
                // Snippet Path
                'snipPath' => $snipPath, //includes $snipFolder
                'snipFolder' => $snipFolder,

                // eForm Params
                'vericode' => isset($vericode)? $vericode:"",
                'formid' => isset($formid)? $formid:"",
                'from' => isset($from)? $from:$modx->config['emailsender'],
                'fromname' => isset($fromname)? $fromname:$modx->config['site_name'],
                'to' => isset($to)? $to:$modx->config['emailsender'],
                'cc' => isset($cc)? $cc:"",
                'bcc' => isset($bcc)? $bcc:"",
                'subject' => isset($subject)? $subject:"",
                'ccsender' => isset($ccsender)?$ccsender:0,
                'sendirect' => isset($sendirect)? $sendirect:0,
                'mselector' => isset($mailselector)? $mailselector:0,
                'mobile' => isset($mobile)? $mobile:'',
                'mobiletext' => isset($mobiletext)? $mobiletext:'',
                'autosender' => isset($autosender)? $autosender:$from,
                'autotext' => isset($automessage)? $automessage:"",
                'category' => isset($category)? $category:0,
                'keywords' => isset($keywords)? $keywords:"",
                'gid' => isset($gotoid)? $gotoid:$modx->documentIdentifier,
                'noemail' => isset($noemail)? ($noemail):false,
                'saveform' => isset($saveform)? ($saveform? true:false):true,
                'tpl' => isset($tpl)? $tpl:"",
                'report' => isset($report)? $report:"",
                'allowhtml' => isset($allowhtml)? $allowhtml:0,
                //Added by JJ
                'replyto' => isset($replyto)? $replyto:"",
                'language' => isset($language)? $language:$modx->config['manager_language'],
                'thankyou' => isset($thankyou)? $thankyou:"",
                'isDebug' => isset($debug)? $debug:0,
                'reportAbuse' => isset($reportAbuse)? $reportAbuse:false,
                'disclaimer' => isset($disclaimer)?$disclaimer:'',
                'sendAsHtml' => isset($sendAsHtml)?$sendAsHtml:false,
                'sendAsText' => isset($sendAsText)?$sendAsText:false,
                'sessionVars' => isset($sessionVars)?$sessionVars:false,
                'postOverides' => isset($postOverides)?$postOverides:0,
                'eFormOnBeforeMailSent' => isset($eFormOnBeforeMailSent)?$eFormOnBeforeMailSent:'',
                'eFormOnMailSent' => isset($eFormOnMailSent)?$eFormOnMailSent:'',
                'eFormOnValidate' => isset($eFormOnValidate)?$eFormOnValidate:'',
                'eFormOnBeforeFormMerge' => isset($eFormOnBeforeFormMerge)?$eFormOnBeforeFormMerge:'',
                'eFormOnBeforeFormParse' => isset($eFormOnBeforeFormParse)?$eFormOnBeforeFormParse:'',
                'cssStyle' => isset($cssStyle)?$cssStyle:'',
                'jScript' => isset($jScript)?$jScript:'',
                'submitLimit' => (isset($submitLimit) && is_numeric($submitLimit))?$submitLimit*60:0,
                'protectSubmit' => isset($protectSubmit)?$protectSubmit:1,
                'requiredClass' => isset($requiredClass)?$requiredClass:"required",
                'invalidClass' => isset($invalidClass)?$invalidClass:"invalid",
                'runSnippet' => ( isset($runSnippet) && !is_numeric($runSnippet) )?$runSnippet:'',
                'autoSenderName' => isset($autoSenderName)?$autoSenderName:'',
                'attachmentField' => isset($attachmentField)?$attachmentField:'',
                'attachmentPath' => isset($attachmentPath)?$attachmentPath:'',
                'errorTpl' => isset($errorTpl)?$errorTpl:'<div class="errors"><strong>[+ef_message_text+]</strong>
                [+ef_wrapper+]</div>',
                'errorRequiredTpl' => isset($errorRequiredTpl)?$errorRequiredTpl:'<span class="requiredlist"><span>[+ef_required_list+]</span>.</span>',
                'errorRequiredSeparator' => isset($errorRequiredSeparator)?$errorRequiredSeparator:'</span>, <span>',
                'version' => '1.4.6'
                );

                // pixelchutes PHx workaround
                foreach( $params as $key=>$val ) $params[$key] = str_replace( array('((','))'), array('[+','+]'), $val );

                # Start processing

                include_once ($snipPath."eform.inc.php");

                $output = eForm($modx,$params);

                # Return
                return $output;
                ?>
                ?> [ed. note: purensimple last edited this post 7 years, 9 months ago.]
                  • 36687
                  • 24 Posts
                  Thanks, purensimple.
                  It all works again!!
                    • 13226
                    • 953 Posts
                    This problem has probably already been sorted in the latest DEV version

                    You can view the history here

                    As you can see, there have been modifications since the release of 1.1, also due to problems with "pixelchutes PHx workaround", as can be read here
                      • 45694
                      • 6 Posts
                      Quote from: scottr at Aug 01, 2016, 05:27 PM
                      Thanks, purensimple.
                      It all works again!!

                      Good to hear, cheers!