Simplifying Notification for Multiple Recipients

Hi everyone,

I’m trying to set up a notification system where I can dynamically choose which device(s) receive a notification through the Home Assistant mobile app. I have an input_select to choose the recipient:

input_select:
  notification_recipient:
    name: Select Notification Recipient
    options:
      - "My Phone"
      - "Wife Phone"
      - "Both"
    initial: "Both"
    icon: mdi:account-multiple

I want to send notifications based on the selected option but am unsure of the best way to do this.

Here’s what I’m considering:

action: >
  {% if is_state('input_select.notification_recipient', 'My Phone') %}
      notify.mobile_app_my_phone
  {% elif is_state('input_select.notification_recipient', 'Wife Phone') %}
      notify.mobile_app_wife_phone
  {% else %}
      notify.group_family_phones
  {% endif %}
data:
  message: "This is the message"

Is this a good approach, or is there a more efficient method to handle multiple notification recipients based on condition?