I am using Magneto 2.3.5-p1, I want to add some custom values in my New Order Transactional email template using block, for that, I have created a custom template from Marketing->Eamil Template
and assigned that template from Store Configuration->Sales->Sales Email
I have added below custom block in my email template
{{block class="Magento\\Framework\\View\\Element\\Template" order=$order name="sample_name" template= "VENDOR_MODULE::checkoutFieldsEmail.phtml" area = "frontend"}}
and in checkoutFieldsEmail.phtml
have added below code even I removed all PHP code and put simple HTML for testing but not showing in email only default content is showing.
I have already added a new column in the sales_order
table and the name of the column is Custom_column
and added some JSON data.
<?php
$helper = $this->helper('Vendor\Module\Data');
$order = $block->getOrder();
if($order):
$_custom_value = $order->getCustom_column();
$coafFields = json_decode($_custom_value,true);
?>