Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Get referrer from UserForms?


Go to End


2 Posts   1889 Views

Avatar
suntrop

Community Member, 141 Posts

3 June 2010 at 2:06am

UserForms saves the 'referrer' as a hidden text field. Is it possible to get this into the mail?

Avatar
Willr

Forum Moderator, 5523 Posts

4 June 2010 at 1:02pm

Not easily in the module. You would have to edit the core UserDefinedForm.php file and add a line around 569 to add the referrer to the list

// new code
$referrer = new SubmittedFormField();
$referrer->Name = "Referrer";
$referrer->Title = "Referrer";
$referrer->Value = urlencode($data['Referrer']);
$referrer->write();

$submittedFields->push($referrer);

// existing code
$emailData = array(
	"Sender" => Member::currentUser(),
	"Fields" => $submittedFields
);