📜  创建电子邮件模板 php 代码示例

📅  最后修改于: 2022-03-11 14:54:39.748000             🧑  作者: Mango

代码示例1
$variables = array();

$variables['name'] = "Robert";
$variables['age'] = "30";

$template = file_get_contents("template.html");

foreach($variables as $key => $value)
{
    $template = str_replace('{{ '.$key.' }}', $value, $template);
}

echo $template;