Miko. eCommerce Template

Mon. - Fri. 9 am - 5 pm Ask a Question
Remember me

How to include URL in email notification

4 years 3 months ago #1

  • Dmitry's Avatar
  • Dmitry
  • Posts: 2
Hi gyus,
is it possible to include the URL of the page from where the the form was sent into the e-mail notification? Would be very useful when one form is used for different pages, i.e. different products.

Thanks in advance, Dmitry

4 years 3 months ago #2

  • Artem's Avatar
  • Artem
  • Posts: 9071
Hi,

For the moment, for each page, you need to create a unique form, and into email notification, you need to add page link manually.

But it's a really nice idea, we'll add it to our TO-DO list, feature will be added in the next versions

Have a nice day!

Regards,

4 years 3 months ago #3

  • Artem's Avatar
  • Artem
  • Posts: 9071
Hi,

Here is solution, for the latest version

Go to: components/com_baforms/helpers/baforms.php
After Line 726, add this code:
$pageUrl = JUri::current();
        if (!empty($_SERVER['QUERY_STRING'])) {
            $pageUrl .= '?'.$_SERVER['QUERY_STRING'];
        }
        $html .= '<input type="hidden" name="page_url" value="'.$pageUrl.'">';

Go to: components/com_baforms/models/form.php
After Line 1339, add this code:
$pos = strrpos($letter, '</tbody>');
        $tr = '<tr><td style="width:100%; padding: 0 20px;">Page URL:';
        $tr .= $_POST['page_url'].'</td></tr>';
        $start = substr($letter, 0, $pos);
        $letter = $start.$tr.'</tbody></table>';

Regards,
Powered by Kunena Forum