Jump to content

Recommended Posts

Posted

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

.

Posted

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.

  • Like 2
Posted (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 by dab

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...