Hi,
I would like to do the following:
I have an accommodation page, that contains a contact email as TV for the email address of the owner of that accommodation.
Each accommodation page has a button for "Contact the owner".
This button would point to the URL of the contact page (with the eForm) with an extra parameter in the URL to define the email address (based on the TV).
Then the contact page, would use that parameter in the URL to make the eForm call with the right recipient email address.
Do you think it is possible and is it the right way to do it?
Julien
-
☆ A M B ☆
- 24,524 Posts
That would certainly work; you would use a snippet to collect the $_GET value and return it, and use that snippet as the value for the &to= parameter in the eForm call.
$mail = $_GET['email'];
// do something to validate the email here
return $mail;
then in the eform
[!eForm? ... &to=`[[getMail]]` ... !]
Thanks for the help.
Is there another way to implement what I’d like to achieve without exposing the email address in the URL?
I would prefer not to reveal the email address of the people.
-
☆ A M B ☆
- 24,524 Posts
Just pass the ID of the referring document in the URL; the snippet will have to query the database to pull the value of that document’s TV.
Load it into the SESSION array.
Make the link on the previous page a form with the address in a hidden field (and style the submit button to look like a plain link if you want to); encrypt the email address before loading it into the hidden field’s value attribute. Then use a snippet to get the POST value and decrypt it before passing it on to the eForm snippet parameter.
Get the doc ID of the REFERRAL page and get the value of the TV for that document; no need for the doc ID in the URL.
Thank you, I will play around with that.