Include page name in express form submission

Permalink
I have a subscribe form attached to Calendar & Events pages.
The problem is that I can't see from which page someone has subscribed.
I would say the simplest solution would be to include the page name in a form submission.

But how to include the page name in an express form submission?

Dutchwave
 
cmerritt replied on at Permalink Reply
cmerritt
Hi,

I created an over ride for the core express form submission to include the page name plus customise the email content.
Save to application/mail/block_express_form_submission.php

<?php
defined('C5_EXECUTE') or die("Access Denied.");
$formDisplayUrl = URL::to('/dashboard/reports/forms', 'view', $entity->getEntityResultsNodeId());
$submittedData = '';
foreach($attributes as $value) {
    $submittedData .= $value->getAttributeKey()->getAttributeKeyDisplayName('text') . ":\r\n";
    $submittedData .= $value->getPlainTextValue() . "\r\n\r\n";
}
$p = Page::getCurrentPage();            
$title = $p->getCollectionName();
$body = t("
There has been a submission of the %s from %s on your website.
%s
", $formName, $title, $submittedData);



Colin
Dutchwave replied on at Permalink Reply
Dutchwave
Thanks a lot, that works!