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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

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   2022 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
);