Forums

URL Referrer in email

andrewau 07 Mar, 2016
Hi

I wonder is there a way to send the URL of the page referrer where the form was submitted. I have an enquiry form loaded in a module position on 100 K2 items. I would like to get the URL that the user was on when they send an enquiry so I can match the form with the product they are enquiring about. Is there a way to do this? Thanks.
GreyHead 07 Mar, 2016
Hi andrewau,

Please see this FAQ. It may well be that K2 has some other clues in the page layout that you could pick up with JavaScript.

Bob
andrewau 09 Mar, 2016
Hi Bob,

Thanks for that, I have followed the FAQ however the URL is not being sent through in the email. I just get a blank for the custom code. Wonder if there is something I am missing?

Thanks
GreyHead 10 Mar, 2016
Hi andrewau,

Please drag a Debugger action into the On Submit event, then submit the form and copy and paste the debug results here - including the 'dummy emails'.

Bob
andrewau 10 Mar, 2016
Hi Bob,
Ok here it is:
Data Array

Array
(
    [option] => com_chronoforms5
    [chronoform] => enquiry
    [event] => submit
    [name] => Andrew
    [text6] => 99998888
    [email] => test@example.com
    [industry] => 0
    [message] => Testing form with URL
    [page_url] => 
    [submit5] => Submit
)

Array
(
)

Errors

Array
(
)

Debug Info

Array
(
    [1] => Array
        (
            [Email] => Array
                (
                    [0] => An email with the details below was sent successfully:
                    [1] => To:andrew@example.com
                    [2] => Subject:Marlin Product Enquiry
                    [3] => From name:Test Site
                    [4] => From email:andrew@example.com
                    [5] => CC:
                    [6] => BCC:
                    [7] => Reply name:
                    [8] => Reply email:
                    [9] => Attachments:
                    [10] => Array
                        (
                        )

                    [11] => Body:
<table>
<tr><td>Custom Code</td><td></td></tr>
<tr><td>Name</td><td>Andrew</td></tr>
<tr><td>Phone</td><td>99998888</td></tr>
<tr><td>Email</td><td>test@example.com</td></tr>
<tr><td>Industry</td><td>0</td></tr>
<tr><td>Custom Code</td><td></td></tr>
<tr><td>Enquiry</td><td>Testing form with URL</td></tr>
<tr><td>URL</td><td></td></tr>
</table><br /><br />
                )

        )

)
GreyHead 10 Mar, 2016
Hi andrewau,

So the page_url has no value when the form is submitted.
What do you have in the On Load / Designer parts of the form to get this?

Bob
andrewau 10 Mar, 2016
Hi Bob,

In On load I just have HTML (Render Form). I can get you admin access if thats easier as well.
GreyHead 10 Mar, 2016
Hi andrewau,

By all means PM me the site URL, the form name, and a SuperAdmin login and I'll take a quick look.

Bob
andrewau 10 Mar, 2016
Thanks Bob, I have sent you through a PM.
This topic is locked and no more replies can be posted.