Posted by Cdhs web administrator on

Can I reference a php script in a Raw HTML includelet? Does e-voice support server side processing of php scripts?

If so, where can I store the php script? In the Assets Library as a document? Or do I have to rerefence with a full URL to say a file on my google drive?

We are an allotment association with 7 sites, say SIteA,SiteB,...SiteG. I have an application form with a multiselect check box listing each site and I want to selectively auto send emails to just the sites that have been checked, rather than just one email to the e-voice admin and then manually forward on or sending an email to all sites even those that do no apply. If the user selects SiteB,SiteD,SiteG I want to send three emails to just those three sites.

Thanks in advance.

2: Re: PHP support (response to 1)
Posted by Cdhs web administrator on

Or could the Froms application in e-voice be extended to add conditional email sending based upon the repliy to a multiselect check box?

3: Re: PHP support (response to 1)
Posted by Joe Oldak on

Hi,

There's no PHP support in Voice. You can't add any kind of server-side scripting to your site. You can in theory do things with JavaScript by adding it into pages or into files that are in your assets library, but this is reasonably advanced stuff of course!

There's no way to set up rules about which email addresses get emailed from Surveys or Forms - these always go to the same address, as specified in the settings.

One option would be to use tools outside of Voice to do the routing. e.g., if Voice always sent the email to a gmail account, you could use the email forwarding rules in gmail to then send those on to different recipients based on the content of the email.

Thanks

Joe

4: Re: PHP support (response to 3)
Posted by Cdhs web administrator on

Ok thanks for the info. An alternative is to create a Google Form and use Google Apps Script (which is an extension of Javascript), which has a GMail object that allows you to do this. Then embed the Google Form in a Raw HTML includelet in e-voice. This also allows us to generate the email body content in a format different to that generated by e-voice Forms. I'll try it and let you know.

5: Re: PHP support (response to 4)
Posted by Cdhs web administrator on

I tried the Google Forms approach. I replaced the previous e-voice Form with a link to a Google Form (opens in a new window). The Google Form has a trigger for OnFormSubmit that fires an Apps script handler that parses the form responses and generates an email to the site managers of just those sites selected in the checkbox. Its a bit tricky to set up but it does work ok. If anyone else needs functionality like this I can give details of how to do it. The form is on our "Apply for a plot" page. Many thanks.