[phorm] Re: Conditionals in email?

  • From: Ken Loomis <kloomis@xxxxxxxxxxxxx>
  • To: phorm@xxxxxxxxxxxxx
  • Date: Mon, 12 Sep 2005 10:22:42 -0700

I figured out a way to do this (the problem outlined in the original email below), but it doesn't really use phorm. If there is a way to use phorm, I'd still like to hear about that.

I used _javascript_ to populate a hidden form field with the URL's for the requested sample reports. Something like this:

<script language="_javascript_" TYPE="text/_javascript_">
<!--
//            <!-- _javascript_ to build samples list -->  
        function buildLinksList(){
            with (document.sampleRequest) {
                samplesList.value = ""
                samplesFileList.value = ""
                if (Enterprise.checked) {
                    samplesList.value = samplesList.value + "http://www.MyDomain.com/samples/Enterprise_Sample.pdf\n\n"
                    samplesFileList.value = samplesFileList.value + "Enterprise_Sample.pdf\n"
                    }
                if (SmallBusiness.checked) {
                    samplesList.value = samplesList.value + "http://www.MyDomain.com/samples/Small_Business_Sample.pdf\n\n"
                    samplesFileList.value = samplesFileList.value + "Small_Business_Sample.pdf\n"
                    }
                if (ClimatePLUS.checked) {
                    samplesList.value = samplesList.value + "http://www.MyDomain.com/samples/Climate_Plus_Sample.pdf\n\n"
                    samplesFileList.value = samplesFileList.value + "Climate_Plus_Sample.pdf\n"
                    }
                if (Leadership360.checked) {
                    samplesList.value = samplesList.value + "http://www.MyDomain.com/samples/Leadership_360_Sample.pdf\n\n"
                    samplesFileList.value = samplesFileList.value + "Leadership_360_Sample.pdf\n"
                    }
                if (BoardEffectiveness.checked) {
                    samplesList.value = samplesList.value + "http://www.MyDomain.com/samples/Effectiveness_Sample.pdf\n\n"
                    samplesFileList.value = samplesFileList.value + "Effectiveness_Sample.pdf\n"
                    }
                if (samplesList.value == "") {
                    samplesList.value = "     No sample reports requested\n"
                    samplesFileList.value = "     No sample reports requested\n"
                    }
                else {
                }
                
            }  // End with (document.sampleRequest)
            return true
        }
//-->
</script>
========================
I am sure there may be more elegant ways to do this, but this works.

All I have to do is use either {{samplesList}} in the email sent to the visitor and {{samplesFileList}} in the email sent to the web site owner.

However, this method would reveal the location of all the sample reports if they wanted to view the source of the samples request page. Not likely for this group of visitors. They are expected to mostly be upper level management for Fortune 500 companies. And, as my client says, if they have the time and inclination to poke around in the HTML to bypass giving him their contact info, he doesn't want them as clients anyway.  ;-)

But as I was building this, I wondered if there were, or would be, a need for a phorm plug-in that would allow encrypted hidden fields. I envisioned that as a two piece utility. One piece would be a PHP page where the web designer could enter the data they wanted encrypted and a key, and it would encrypt the data and present it for them to copy and paste in to the web page. The other piece would be the actual PHP plug-in. There would also have to be a way to indicate to phorm that the field needed to be decrypted; maybe a parameter in the config file to indicate all the encrypted fields like is used to indicate the fields that will be written to a text file or DB. and I'd think it would be fine to give phorm the key via the config file.

That way I could have turned this:
samplesList.value = samplesList.value + "http://www.MyDomain.com/samples/Leadership_360_Sample.pdf\n\n"

into something like this:
samplesList.value = samplesList.value + "ft56H285h&ehrk8Hwurh682jtmsyhe968jdytKtHkiwjct38yjstge"

making it unintelligible to anyone viewing the source of that page.

I doubt I have the time or the PHP expertise yet to do this, so I just thought I'd think out loud In case it makes sense to some one else.

Thanks,
Ken Loomis




Ken Loomis
Consultant
Windows, Macintosh, Internet, etc.
Helping to make your technology
experience more pleasant & profitable ;-)
619-275-6919 / Cell 619-889-7834
KLoomis@xxxxxxxxxxxxx


Ken Loomis wrote:
I am building a page that lets visitors select sample reports to receive from a list of five. I use check boxes to let the visitor select the sample reports they want.

I log the visitor's input to a text file, send the site owner a customized email with the visitor's info, and send the visitor an email.

I'd like the visitor email to
ONLY have the links to the individual reports that they actually selected.

Is there a way to use PHP in the email form to do that? I can't seem to find a mention of it anywhere in the documentation. (But of course, we all know that I have missed important things in the docs before.)

If I can't do it in PHP does anyone have any other suggestions?

I could attach the files they selected, but would rather provide the links.

Thanks for any help or suggestions.
Ken Loomis




Ken Loomis
Consultant
Windows, Macintosh, Internet, etc.
Helping to make your technology
experience more pleasant & profitable ;-)
619-275-6919 / Cell 619-889-7834
KLoomis@xxxxxxxxxxxxx


Phorm Support wrote:
Did you try this:

http://www.phorm.com/support/README_SUPPORT.html#varsub

------------------------------------------------- You are receiving this message because you are subscribed to the Phorm mailing list. To send messages to the mailing list, simply send email to phorm@xxxxxxxxxxxxx from the address you have subscribed. You may unsubscribe from the list by sending email to phorm-request@xxxxxxxxxxxxx with 'unsubscribe' in the SUBJECT field.
------------------------------------------------- You are receiving this message because you are subscribed to the Phorm mailing list. To send messages to the mailing list, simply send email to phorm@xxxxxxxxxxxxx from the address you have subscribed. You may unsubscribe from the list by sending email to phorm-request@xxxxxxxxxxxxx with 'unsubscribe' in the SUBJECT field.

Other related posts: