I have tried the email templates. It makes sending emails a lot easier. Thanks a lot for your hard work.
One question: How can I format the date differently? It always appears in yyyy-mm-dd format. I want to format it as dd.mm.yyyy.
Welcome to the nuBuilder Forums!
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Email templates
-
- nuBuilder Team
- Posts: 4581
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 536 times
- Contact:
Re: Email templates
Hi,
Replace the Hash Cookie with the formatted date value before it's replaced with nuReplaceHashVariables():
Replace the Hash Cookie with the formatted date value before it's replaced with nuReplaceHashVariables():
Code: Select all
function formatDate($date, $format) {
if ($date == "") {
return "";
}
$date = DateTime::createFromFormat('Y-m-d', $date);
return $date->format($format);
}
$body = nl2br($template['body'];
$body = str_replace( "#"."your_field"."#", formatDate("#your_field#", "d.m.Y"), $body );