on 06-17-2015 3:41 PM
Hi,
i have to send every day an email to all collaborators of selected MA.
i wrote a script which will be started as scheduled task.
// ... //
sendMaMail(maLink, emailAddress, userName, msg) {
logInfo("sending e-mail to " + userName + " / " + emailAddress + " => msg from field: " + msg + ", link: " + maLink);
sender = session.getAccount();
mailTypeEnum = new MailTypeEnumType(MailTypeEnumType.ODP_CUSTOM_TEMPLATE1);
NotificationUtil.sendNotification(emailAddress, sender, mailTypeEnum , params,null,null);
}
My problem is that "session.getAccount()" return the current user with his email address.
When the script is running as a scheduled task there is no current user logged in and
"session.getAccount()" return a user with the "sys@mail" email address witch is not valid.
Is there any way to send a "system notification" from scheduled task?
thanks und sorry for my terrible english
Waldemar
Hello Waldemar,
In a scheduled task, session.getAccount() should return the "Run As User" configured in the Scheduled Task. User should have a valid email anyway.
Next, check system property messaging.mail_source_policy. If it is set as SENDERS_COMPANY, then the actual 'from' address will be picked up from the company "Source E-mail:" field.
Somewhere you have a misconfiguration that returns the "sys@mail" value which needs to be corrected.
Bogdan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you very much.
It is running now
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
while setting up the schedule task you will be giving an entry "run as user" , the specific user which you have mentioned will execute the task
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.