Heading in email confirmation

Hi,
Is there a way to change the e-mailtemplate for a specific field? When there is a heading added to a form it renders as follows in the confirmation e-mail:
Type aanvraag [[!+fi.field_140]]
Because the title is empty (can’t be filled in) it shows the placeholder ([[!+fi.field_140]]) in stead of an empty space.
Any ideas?
Thanks, Steffan

Hello @culd ,
have a look here: Merge pull request #2 from jenswittmann/patch-1 · Sterc/Formalicious@06819a9 · GitHub

Hi Jens,
Thanks for having a look at it. The solution you proposed is only front-end, right? I need to hide empty placeholders (or in this case create a markup for the title) in the e-mail confirmation. But it looks like there’s no way to change field tpl’s for emails.

Be sure to submit all the fields on frontend to get a proper placeholder inside the email tpl. So a headline is also a field and you need to submit the data on frontend, thats the reason for the hidden field in the PR (;

Maybe you can create a hook to solve this too, but the hidden field is easier to add.

You can also try to run a custom snippet in the email tpl thats gets all fields from the formalicious form and change the tpl based on the field type.

Here is some old code i used, but maybe it push you in the right direction (:

$formId = $modx->getOption('formId', $scriptProperties, 1);
$formSessionData = $_SESSION['formitStore']['data'];
$o = [];

# get formalicious package
$defaultFormaliciousCorePath = $modx->getOption('core_path').'components/formalicious/';
$formaliciousCorePath = $modx->getOption('formalicious.core_path', null, $defaultFormaliciousCorePath);
$formalicious = $modx->getService('formalicious', 'Formalicious', $formaliciousCorePath.'model/formalicious/', $scriptProperties);

# get formalicious fields in order
$q = $modx->newQuery('FormaliciousStep');
$q->select('FormaliciousField.id, FormaliciousField.title, FormaliciousField.description');
$q->leftJoin('FormaliciousField', 'FormaliciousField', [
    'FormaliciousField.step_id = FormaliciousStep.id'
]);
$q->where([
    'FormaliciousStep.form_id' => $formId,
    'FormaliciousField.published' => 1
]);
$q->sortby('FormaliciousStep.rank ASC, FormaliciousField.rank ASC', '');
$fields = $modx->getIterator('FormaliciousStep', $q);

# loop
if (is_array($formSessionData) && count($formSessionData) > 0) {
	
	foreach ($fields as $field) {
		
		$sessionFieldValue = $formSessionData['field_'.$field->get('id')];
		
		if (!empty($sessionFieldValue)) {
			
			$value = is_array($sessionFieldValue) ? array_shift($sessionFieldValue) : $sessionFieldValue;
			
			$o[] = '
			    <p class="py1 m0 border-bottom border-gray clearfix">
					<span class="col col-6 md-col-4">'.$field->get('title').':</span>
					<span class="col col-7 md-cpl-8">'.$value.' <span class="gray">'.$field->get('description').'</span></span>
				</p>
            ';
		}
	}
}

Yes, pretty obvious but I didn’t think of it :s I went for the first options since there was little budget remaining for this one :slight_smile:
Thanks for the help!