Changing SMTP recipient according to input_text

Hello guys.

I’m willing to send emails to the inbox that was entered by the system user. So I’ve created input_text element and now trying to use {{states('input_text.recipient_email')}}" in configurations.yaml. However, I’m facing “Invalid config for [notify.smtp]: expected an Email @ data[‘recipient’][0]. Got ‘{’. (See /config/configuration.yaml, line 46).” error. I’m wondering is there anything you could suggest to me here?

  name: Dust Alert
  platform: smtp
  port: 587
  timeout: 15
  sender: [email protected]
  username: [email protected]
  password: xxxxx
  recipient: "{{states('input_text.recipient_email')}}"
  sender_name: My Home device

Thank you!

Unless the options of an integration specifically say they support templates, they don’t.

So you can’t template most integration options.

You use templates in the service call that sends the message in a script or automation.