# how do I email results that are easy to read and confirm each member was added successfully?

**URL:** <https://forum.ansible.com/t/how-do-i-email-results-that-are-easy-to-read-and-confirm-each-member-was-added-successfully/30151>\
**Category:** Ansible Project\
**Created:** [April 19, 2019, 2:48am UTC](https://forum.ansible.com/t/how-do-i-email-results-that-are-easy-to-read-and-confirm-each-member-was-added-successfully/30151 "2019-04-19T02:48:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dennis\_Levens](https://avatars.discourse-cdn.com/v4/letter/d/b782af/32.png) [@Dennis\_Levens](https://forum.ansible.com/u/Dennis_Levens)\
**Post date:** [April 19, 2019, 2:48am UTC](https://forum.ansible.com/t/how-do-i-email-results-that-are-easy-to-read-and-confirm-each-member-was-added-successfully/30151/1 "2019-04-19T02:48:25Z")

</div>

This script is working but the results are difficult to read in the email that is sent.

Ideally I would like the email to say something like:

The following  
Add: {{ member }} To: {{ group }} On: {{ ansible\_hostname }} **[has failed or was successful]**

The following are the current members of the group Administrators on {{ ansible\_hostname }}  
DOM\First\_Group  
DOM\Second\_Group

The data all seems to be in userData but I don’t know how to put some smarts to check it was successful and not sure how to list a clean list of the members of the group.

`

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [April 23, 2019, 2:34am UTC](https://forum.ansible.com/t/how-do-i-email-results-that-are-easy-to-read-and-confirm-each-member-was-added-successfully/30151/2 "2019-04-23T02:34:56Z")

</div>

Create a template that formats it nicely and use:

body: '{{lookup("template", "pretty\_email.j2")}}'

You could try to do the same inline, but it ends up making the task  
hard to read and update.

---

<div class="post-metadata">

**Author:** ![Dennis\_Levens](https://avatars.discourse-cdn.com/v4/letter/d/b782af/32.png) [@Dennis\_Levens](https://forum.ansible.com/u/Dennis_Levens)\
**Post date:** [April 29, 2019, 9:51pm UTC](https://forum.ansible.com/t/how-do-i-email-results-that-are-easy-to-read-and-confirm-each-member-was-added-successfully/30151/3 "2019-04-29T21:51:17Z")

</div>

Thanks Brian, I will look into this option 🙂
