Including html in Express Form submission

Permalink
Hi all,

I have been tearing my hair out over this, not sure if it's possible but the issue is as follows. I am developing a site for a client in which he is listing his products. These products can't be purchased online, but there is an enquiry form on each product page. I have managed to include the page title of each product so he can see where the enquiry is originating from, by including the following code in /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("
Submission of the %s form, from %s on your website.
%s
", $formName, $title, $submittedData);


Now this isn't entirely ideal since if someone submits from the Contact page that will also show, but it doesn't matter overly. What I'd *like* to do is format the resulting text in the email he receives so that the page title is in bold, making it easier for him to pinpoint the product in question. Is there any way to include and render html in this specific section:

$body = t("
Submission of the %s form, from %s on your website.
%s
", $formName, $title, $submittedData);


Appreciate any help I can get!

gracehcoote
 
goesredy replied on at Permalink Reply
goesredy
if you want to use HTML in email, change
$body = t("..");

...to this:
$bodyHTML = t("..");


Now you can edit the contents of the email in HTML mode.