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.

All other Modules /

Discuss all other Modules here.

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

Get referrer from UserForms?


Reply


2 Posts   1294 Views

Avatar
suntrop

Community Member, 131 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, 5513 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
);