Jump to:

10979 Posts in 2722 Topics by 1815 members

All other Modules

SilverStripe Forums » All other Modules » Get referrer from UserForms?

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 1219 Views
  • suntrop
    Avatar
    Community Member
    131 Posts

    Get referrer from UserForms? Link to this post

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

  • Willr
    Avatar
    Forum Moderator
    5497 Posts

    Re: Get referrer from UserForms? Link to this post

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

    1219 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.