adrianmak Posted April 12, 2016 Share Posted April 12, 2016 When editing a page content, the client want to receive visitor enquiry. For example, a piece of content may looks like, Duis scelerisque cum enim ut ullamcorper feugiat augue aptent a eu cursus faucibus a a ullamcorper ac condimentum commodo ornare venenatis ad sed ac proin consectetur penatibus. Sapien a curae senectus vestibulum ornare consectetur cursus consectetur egestas id dictum venenatis nisi eu odio conubia lacus. Pulvinar a rutrum mi mi nostra id sed vestibulum luctus pharetra a cubilia vestibulum vehicula scelerisque himenaeos class a viverra parturient metus ad a porttitor.Adipiscing nunc proin inceptos in sodales fringilla arcu sem adipiscing vehicula euismod hendrerit eget blandit。 Please contact ask thru info@example.com or info@xyz.com Then I built an enquiry form for client, the client could make the email address as hyper link, link to the enquiry form page i.e. <a href="/enquiry">info@example.com</a> or <a href="/enquiry">info@xyz.com</a> The problem is, I hard-coded both email addresses in the code of the enquiry page template. Clicking either info@example.com or info@xyz.com, the form data will be sent to both email addresses. The client does not want this behaviour . Link to comment Share on other sites More sharing options...
LostKobrakai Posted April 12, 2016 Share Posted April 12, 2016 That's what GET parameters are for /enquiry/?email=1234, if you've them saved in some page, or /enquiry/?email=info%40xyz.com if you just want to pass the email address. 2 Link to comment Share on other sites More sharing options...
dab Posted April 12, 2016 Share Posted April 12, 2016 (edited) Not sure if I am off topic... but I have a contact form on each (user) page, with form output needing to go a specific email address associated with that (unique) page. So....create a field holding the email address for that page e.g. {contact_email} Then add the Contact Form Module to your template.... <?php $options['emailTo'] = $page->contact_email; $options['emailSubject'] = 'Enquiry via xxxxxx website'; echo $modules->get('SimpleContactForm')->render($options); ?> note the 'emailTo' overrides what ever you have set in the Simple Contact Form "emailTo" Settings ...neat eh? See here for more details: https://github.com/justonestep/processwire-simplecontactform/blob/master/doc/usage-advanced.md Use a select field in the form to choose which email address is selected....? Edited April 12, 2016 by dab Link to comment Share on other sites More sharing options...
adrianmak Posted April 12, 2016 Author Share Posted April 12, 2016 I think LostKobrakai suggestion is more likely to fit my case Link to comment Share on other sites More sharing options...
LostKobrakai Posted April 13, 2016 Share Posted April 13, 2016 Just be sure to sanitize the entry or people can just pass arbitrary emails to be send to, which you don't want to happen. 1 Link to comment Share on other sites More sharing options...
netcarver Posted April 13, 2016 Share Posted April 13, 2016 Whitelisting the allowed email addresses sounds like a good approach to take here. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now