# Data Directive to send an email only works for specific user
**Category:** [Epicor ERP 10](https://www.epiusers.help/c/e10/5)
**Created:** 2016-12-14 16:50 UTC
**Views:** 6318
**Replies:** 35
**URL:** https://www.epiusers.help/t/data-directive-to-send-an-email-only-works-for-specific-user/36606
---
## Post #1 by @ckrusen
I created a data directive to email a copy of the Packer after either the Shipping Status changes to "Shipped", or if the Tracking Number of an already shipped packer is changed.
Works fine if I'm the one that sets the packer to Shipped" or changes the tracking number. But nothing happens for any other user.
Thoughts on where to look?
Calvin
---
## Post #2 by @jgiese.wci
Does it include customer information your data your working with and do you have the CRM module enabled?
Joshua Giese
Technology Solutions : CTO
Direct Phone: 920.593.8299
Office Phone: 920.437.6400 x342
[http://wcibags.com/email/emailFooter4.jpg]
---
## Post #4 by @Chris_Conn
Message Box in BPM:
```cs
this.PublishInfoMessage("My Message",
Ice.Common.BusinessObjectMessageType.Information,
Ice.Bpm.InfoMessageDisplayMode.Individual,
"Chris Title", "Chris Comments");
```
Also, I see it's set to Company Specific - are you in the same company as your other intended users?
Do the intended users have rights to close the record?
---
## Post #5 by @ckrusen
Since I'm still new to E10's BPM interface, how exactly do I implement that code?
Replace the AutoPrint object with a "Execute Custom Code" ? Can I just put the ExecCustCode object between Condition0 and AutoPrint1 ?
---
## Post #6 by @Chris_Conn
Create a Custom Code object and enter the code (click the cod> link in the action bar)
---
## Post #7 by @Chris_Conn
Yes, you can insert the code into the chain. Note that since it's synchronous, the events after that block wont occur until after you dismiss the message. As I recall, you CANNOT run the message box in a asynchronous context
---
## Post #8 by @Chris_Conn
Just making sure you saw these comments above:
[quote="Chris_Conn, post:4, topic:36606"]
Also, I see it's set to Company Specific - are you in the same company as your other intended users?
Do the intended users have rights to close the record?
[/quote]
I think if I wanted to track down the issue, I would separate all of my conditions into separate blocks, with a debug statement after each condition is met - this way you can tell what conditions aren't being met (assuming you are firing the BPM at all - debug message at start could solve that)
---
## Post #9 by @ckrusen
I added a debug message between the Start and Condition 0, and another between Condition0 and the AutoPrint.
I get each message, and the email when **I run it.**
Now to see what others get...
---
## Post #10 by @ckrusen
Had another user do the thing that triggers the BPM. They saw both messages (one after Start and one after the Condition).
But no email was sent.
---
## Post #11 by @Rick_Bird
My guess is the issue is with AutoPrint, do you have other AutoPrint BPM's that are working for other users?
I had a terrible time getting AutoPrint to work properly in 10.0. Most of my issues seemed to stem from needing to host the printer share on the app server and then making sure users had access to the printer share.
---
## Post #12 by @Chris_Conn
Try using this code instead of the automailer:
```cs
var mailer = this.GetMailer(async: true);
var message = new Ice.Mail.SmtpMail();
message.SetFrom("email@email.com");
message.SetTo("email1@email.com;email2@email.com");
//message.SetCC()
//message.SetBcc()
message.SetBody("
MyMessage Here
"); Dictionary
AutoPrint
Auto Print _**selected**_ options "Report Options" tab
Auto Print _**selected**_ options "Report Parameters" tab (not shown are :
PrintReportParameters : False
SSRSEnableRouting: False
SSRS Email / Fax setup
---
## Post #31 by @Chris_Conn
Report permissions for the user? I am grasping at straws here.
Also I vaguely remember an issue I had with autoprint and bartender where I HAD to run the task queued (Run Schedule) otherwise I had weird results.
---
## Post #32 by @ckrusen
Here's what I've done, and the results...
* Created a user with all rights the same as typical users (Sec Mngr: NO, Allow Imp: NO)
* This test user can send email using the email option in print dialogs (pict below)
* Task Status in the Sys Monitor says COMPLETE, and email was received
* Test user triggers BPM (verified by message boxes), but the Sys Monitor shows the task status of ERROR
* Task Error details:
`Program Ice.Services.Lib.RunTask raised an unexpected exception with the following message: RunTask: User Account is not set to 'Allow Session Impersonation'`
* Changed test users acct setting to Allow Imp: YES (Sec Mgr is still NO)
* Closed test users session and re-launched (to make sure changes to user account settings are applied)
* Test user triggers BPM (verified by message boxes), but the Sys Monitor shows the task status of ERROR, with the same details from above
* Changed test users acct setting to Allow Imp: YES , Sec Mgr: YES. Closed test users session and re-launched (to make sure changes to user account settings are applied)
* Test user triggers BPM (verified by message boxes), but the Sys Monitor shows the task status of ERROR, with the same details from above
**NOTE:** Test user account has a domain and OS ID assigned to it. But it is not an actual AD account.
To make sure this wasn't an issue, I tried all the above with another user account which is tied to an AD account. And got the same results.
---
## Post #33 by @srossberg
In Task Agent setup in the Epicor Admin Console what is the username for the task agent in the app server you are using and does that user have impersonation rights?
---
## Post #34 by @ckrusen
The task agent uses a user created specifically for the System Agent.
**In User Acct Maint:**
User ID: print
Domain: