CGBetterForms dynamic recipient email variable

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Mich-adg
Forum Members
Forum Members
Posts: 199
Joined: Sat Aug 02, 2008 9:08 pm

CGBetterForms dynamic recipient email variable

Post by Mich-adg »

Hi,

i'm looking for a tip to pass a variable to a CGBetterForm: for example, i have a $destemail set in a Lise mod. detail page (scope=global), but how to tell the form to use this variable as recipient email after submit?

Thx for any help!
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1609
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: CGBetterForms dynamic recipient email variable

Post by DIGI3 »

You could assign it to a hidden form field in your template, then use the "Send email to user supplied address" handler.

If you don't want the address in the form template, then you could put an empty hidden field in the form, then use the "Computed value field" to populate it with the variable, then use the supplied address handler.

Note: I haven't tested these, just brainstorming.
Not getting the answer you need? CMSMS support options
Mich-adg
Forum Members
Forum Members
Posts: 199
Joined: Sat Aug 02, 2008 9:08 pm

Re: CGBetterForms dynamic recipient email variable

Post by Mich-adg »

Thanks, but i can't see "Computed value field" option (but computed page / url only).
Yes i have a hidden field in the form with my recipient email, and i tried this after your comments:
Create a

Code: Select all

<div style="display:none"><input id="destemail" class="form-control" type="email" class="form-control" name="destemail" value="{$destemail}" /></div>
and a Handler "Send a copy of the submission to the user address specified in the destemail field" and it works !
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1609
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: CGBetterForms dynamic recipient email variable

Post by DIGI3 »

You might want to set the input field to readonly and autocomplete="off" so it doesn't get overwritten by auto form fillers.

The 'compute a field value' is a validator, not a handler. It's just a bit safer as then it can't get changed by the visitor. I'm just not sure whether it would be able to access a global variable, I think I've run into an issue with that before.
Not getting the answer you need? CMSMS support options
Mich-adg
Forum Members
Forum Members
Posts: 199
Joined: Sat Aug 02, 2008 9:08 pm

Re: CGBetterForms dynamic recipient email variable

Post by Mich-adg »

Yes i was looking to "protect" this field, thanks for the tips!
Post Reply

Return to “Modules/Add-Ons”