SC Field Tags in HTML Email Template

Good day,
I am trying to add SC tag in HTML email template, shown below. I am still fairly new to SC.

Event: After Insert

As shown the HTML file is pulled externally with these fields embedded.

When email is generated fields do not show.
I know it is more of a knowledge gap, let me know the proper way in which to do it.


Found my answer on the forum using str_replace.


1 Like

I realised you are using an external html, and just replacing the placeholders with php,
so it should work, after the replace, just do echo $file and see if things go replaced,.

in case you put the template in the html part of a control application, you can use my previous advice , which i deleted but here is a reminder.

Php runs first, and changes html which is send to the user.
Therefore you need to enclose all variable fields in php open and close tag and echo the field using php syntax.

There are plenty of examples , this is how dynamic html is created.

For example (<?= is the same as <?php echo. , just a shorter notation )
my $AdresLable and $ObjectAddress are defined in the onload event of a control application. I guess you can use the fields variables directly , but if does not work , you need to define variables and assign values from the fields to them in the onload event.