Passing message variable to notify command_line

All,
I’m struggling with passing variables to my custom script and couldn’t find in the forum what I’m doing wrong. The script works fine, but instead of using the variable message, I receive “{{ message }}” as the hard-coded content. Can someone point me in the right direction?

notify:
  - name: imessage
    platform: command_line
    command: >
      bash /config/scripts/imessage.sh {{ message }}

After doing more research on this, I don’t think it’s possible to pass a variable using the command_line notify syntax.

I created a shell_command config instead:

shell_command:
  imessage: >
    bash /config/scripts/imessage.sh {{ target }} "{{ message }}"

And a REST notify config that calls this script:

  - name: imessage
    platform: rest
    resource: 'http://homeassistant:8123/api/services/shell_command/imessage'
    method: POST_JSON
    headers:
      authorization: !secret imessage_rest
      content-type: 'application/json'
    message_param_name: message
    target_param_name: target

Now everything seems to be working fine.