# User role as recipients for email

**URL:** <https://forum.inductiveautomation.com/t/user-role-as-recipients-for-email/74375>\
**Category:** Ignition\
**Created:** [May 31, 2023, 5:03pm UTC](https://forum.inductiveautomation.com/t/user-role-as-recipients-for-email/74375 "2023-05-31T17:03:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbb5310](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@jbb5310](https://forum.inductiveautomation.com/u/jbb5310)\
**Post date:** [May 31, 2023, 5:03pm UTC](https://forum.inductiveautomation.com/t/user-role-as-recipients-for-email/74375/1 "2023-05-31T17:03:12Z")

</div>

When using the user roles I get this error.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/7/b7a54bf1c82e1a6030ee4e29691cbb14441eadd5.png)

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 31, 2023, 5:25pm UTC](https://forum.inductiveautomation.com/t/user-role-as-recipients-for-email/74375/2 "2023-05-31T17:25:14Z")

</div>

So what's your question?

 ![Ignition email](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/0/f0130587c21ac04a136466c05b6ea1a11c9e1109.png)

1. Check your database column names and your query to find the error.
2. I can't see what's causing this.
3. I can't see what's supposed to generate the 'to' addresses.
4. 'Test@Ignition' is not a valid email address. Try adding '.com'.
5. Is the same as 3.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [May 31, 2023, 5:27pm UTC](https://forum.inductiveautomation.com/t/user-role-as-recipients-for-email/74375/3 "2023-05-31T17:27:27Z")

</div>

I never emailed based on roles before but 3 and 5 from what you pointed out - @jbb5310 are there any users with those roles that have an email associated with them? Maybe you have users with those roles but no emails for those users?

---

<div class="post-metadata">

**Author:** ![jnqplas](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jnqplas/32/4054_2.png) [@jnqplas](https://forum.inductiveautomation.com/u/jnqplas)\
**Post date:** [May 31, 2023, 6:35pm UTC](https://forum.inductiveautomation.com/t/user-role-as-recipients-for-email/74375/4 "2023-05-31T18:35:37Z")

</div>

I'm working with the OP on here. The schedule is set up (annoyingly changes per day), and the parameters are configured in Data. We've narrowed it down to the following errors. However, we're not able to address items 3, 4, or 5 (as called out by Transistor above). I'm assuming this built-in user roles function on the report module works in v7.9 (yes, I know). As you can see in the circled areas, everything seems to be verified. We've also played around with the ReplyTo User Source (#4) and still get the same error. The manual calls this out as Optional anyway.

We do e-mail reports from this server.

There are users with valid e-mails associated with this role. It's just the two of us until it's proven.

Has anyone been successful with using this function? We saw a similar posting referencing system.report.execute, but I'd much prefer to handle everything "locally" rather than trying to reference external scripts and such.  
ref: [Scheduled report with scripted parameters](https://forum.inductiveautomation.com/t/scheduled-report-with-scripted-parameters/58395)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/1/c1f05f9a141e1500bb02eb1463cc5566a7d2ea20.png)

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [May 31, 2023, 9:27pm UTC](https://forum.inductiveautomation.com/t/user-role-as-recipients-for-email/74375/5 "2023-05-31T21:27:13Z")

</div>

Going through the code, it looks like the user source for your TO addresses was successfully contacted but no users were found with that role. You might double check with a script (copy and paste the role name to be sure) that you are able to pull the roles, because the report sure isn't seeing users with that role and a contact type of email.

For the reply-to, well that role is blank, so that error is easy to solve. I suspect that may solve the last error as well.
