diff --git a/playbooks/notifications/email-notify-list-of-users.yml b/playbooks/notifications/email-notify-list-of-users.yml index 6636bcc0..0a65378f 100644 --- a/playbooks/notifications/email-notify-list-of-users.yml +++ b/playbooks/notifications/email-notify-list-of-users.yml @@ -15,8 +15,7 @@ - set_fact: mail: "{{ mail | combine({ 'subject': title, 'body': md_to_html.html_body_message }) }}" - set_fact: - list_of_mail_to: "{{ list_of_mail_to | default([]) }} + [ '{{ item.email }}' ]" - with_items: - - "{{ list_of_users }}" + list_of_mail_to: "{{ list_of_mail_to | default([]) + [ item.email ] }}" + loop: "{{ list_of_users|flatten(levels=1) }}" - include_role: name: notifications/send-email