Sending array via variable to notify.html5_push

Hey all, i have some issues with the html5 push notification.
Based on the automation which triggers this script I want to dynamically set the target(s). I found out that arrays/lists can’t be sent via a variable as they are converted to strings. Can anybody help me with this?

Here’s the script.

notify_engine:
  sequence:
    - service: notify.html5_push
      data_template:
        title: "{{ title }}"
        message: "{{ message }}"
        target: "{{ target }}

Also tried this way but this isn’t also working:

notify_engine:
  sequence:
    - service: notify.html5_push
      data_template:
        title: "{{ title }}"
        message: "{{ message }}"
        target: >
          {% if who == 'husband' %}
             ["husband", "husband_desktop"]
          {% elif who == 'wife' %}
             ["wife"]
          {% elif who == 'parents' %}
             ["husband", "husband_desktop", "wife"]
          {% else %}
             ["husband"]
          {% endif %}