Getting value of a specific field (email) to pass to detail page for a contact form

Permalink Browser Info Environment
Hi

I've been trying to come up with a solution to this for a while and wondered if anyone else has done anything similar

I have a list of employees that is created with Advanced Forms, and they each have an email address field associated with them. What I want to do, is when the Details link is clicked on one of the employees in the list, the user is then taken to another page with a contact form for that employee. In other words, the contact form on this page will send the contact form notification to an email address that is decided dynamically by the employee that was clicked on in the list, and takes the email address from there.

I have this modified code so far in blocks/form/controller.php:

$mh = Loader::helper('mail');


$sendtoemail = $emailaddressfromlist;

$page = Page::getCurrentPage();
$pageParent = Page::getByID($page->getCollectionParentID());
if ($pageParent->getCollectionName() == "Employee List") {
$mh->to( $sendtoemail );
}
else {
$mh->to( $this->recipientEmail );
}

What I can't work out is how to go about getting the email address from the employee list on the list page and pass that value to $emailaddressfromlist once on the detail page

Anyone have any ideas?

Much appreciated!

Type: Discussion
Status: New
InSynch
View Replies:

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.