How do I call a function or add the contents of a variable to a message\notification in HA?

I’m trying to add a time stamp to an email that HA is sending out.

For example

service: notify.email_notification
data:
  message: Insert message here
  title: The current date and time is {{ now().strftime('%Y-%m-%d %H:%M:%S') }}
  target: Insert email address here

When I try to do this I receive the following error message:

Visual editor is not supported for this configuration
Templates not supported in visual editor
You can still edit your config in YAML.

I’m not sure if I’ve just gotten the syntax wrong, or if this is completely the wrong way to go about doing this.

I’ve read the help documents but don’t really understand what they’re telling me to do, so please don’t link to them and tell me to read them. I’m still getting used to how HA does things, and a lot of it is confusing. I could do with an explanation of what I’m specifically doing wrong in this specific example.

You have to quote single line templates.

title: "The current date and time is {{ now().strftime('%Y-%m-%d %H:%M:%S') }}"

Where are you entering this?

Settings - Automations & Scenes - +Create Automation

Actions - Edit in YAML.

You have to quote single line templates.

I’m not sure what that means. Do I need to put the Double quote (") mark around it?

Yes as I showed in my reply.

OK, I hadn’t noticed that you’d changed anything.