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!
CGBetterForms dynamic recipient email variable
Re: CGBetterForms dynamic recipient email variable
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.
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
Re: CGBetterForms dynamic recipient email variable
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
and a Handler "Send a copy of the submission to the user address specified in the destemail field" and it works !
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>
Re: CGBetterForms dynamic recipient email variable
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.
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
Re: CGBetterForms dynamic recipient email variable
Yes i was looking to "protect" this field, thanks for the tips!