• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: CGBetterForms dynamic recipient email variable
PostPosted: Wed Sep 05, 2018 9:04 am 
Offline
Forum Members
Forum Members

Joined: Sat Aug 02, 2008 9:08 pm
Posts: 188
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!


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: CGBetterForms dynamic recipient email variable
PostPosted: Wed Sep 05, 2018 2:33 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Feb 25, 2009 4:25 am
Posts: 796
Location: Victoria, BC
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


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: CGBetterForms dynamic recipient email variable
PostPosted: Wed Sep 05, 2018 4:53 pm 
Offline
Forum Members
Forum Members

Joined: Sat Aug 02, 2008 9:08 pm
Posts: 188
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:
<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 !


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: CGBetterForms dynamic recipient email variable
PostPosted: Wed Sep 05, 2018 4:59 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Feb 25, 2009 4:25 am
Posts: 796
Location: Victoria, BC
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


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: CGBetterForms dynamic recipient email variable
PostPosted: Wed Sep 05, 2018 6:53 pm 
Offline
Forum Members
Forum Members

Joined: Sat Aug 02, 2008 9:08 pm
Posts: 188
Yes i was looking to "protect" this field, thanks for the tips!


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Hosting Nation - Managed CMSMS Hosting