Hi,

I got a Webform in a Block using the Webform Block module. Is it possible to see in the submission email we recieve, which page/node the webform was submitted from...

I have several different pages/nodes, but using the same webform (block).. I want to see from which page/node the webform(block) was submitted..

Iam using url alias, so I would love to see the current url alias...

Or Page Title... or anything else User-friendly readable..

Thanks for the help.

Comments

budda’s picture

Priority: Major » Normal
Status: Active » Closed (fixed)

webform allows inserting $_SERVER variables in to your emails. Experiment with them.

dthiessen’s picture

Status: Closed (fixed) » Active

The above solution does work but I believe only with logged in users. Is there a way to get the current url for anonymous users as well?

sdragnev’s picture

Here's the code I added to the webform.module to get it to work for me when used in a block:

if ($node->title == 'Organization Correction form') {
        $q = $_GET['q'];
        $q = explode('/',$q);
        $qid = (int) $q[1];
        $node1 = node_load($qid);
        $node->title = $node1->title;
}

The title in the if statement is whatever the webform node title is for you.
Ugly but it works.

Derived it from the patch submitted by amccabe at http://drupal.org/node/1224130.