[jboss-user] [jBPM Development] - Mail template for custom MailProducer

Alejandro Guizar do-not-reply at jboss.com
Wed Apr 21 13:58:58 EDT 2010

Alejandro Guizar [http://community.jboss.org/people/alex.guizar%40jboss.com] replied to the discussion

"Mail template for custom MailProducer"

To view the discussion, visit: http://community.jboss.org/message/538838#538838

> By the way, most user only create create a custom MailProducer to bypass the requirement of the default MailProducerImpl that mail recepients  need to exist in the Indentity tables.
> ~~~~~~
> List<User> users = identitySession.findUsersById(userIds);
> ~~~~~
> Don't quite understand that, especially if I want the workflow to trigger an email to an external customer.
The code you indicate is guarded by a condition:
String userList = fromTemplate.getUsers();
if (userList != null) {
  String[] userIds = tokenizeActors(userList, execution);
  List<User> users = identitySession.findUsersById(userIds);
  email.addFrom(resolveAddresses(users, addressResolver));

If you don't need users and groups from the identity tables, your template should only specify the *addresses* attribute to enumerate recipients. Avoiding the *users* and *groups* attributes also prevents access to the identity session. However, since you have looked at the source code you probably knew this already - am I missing something?


Reply to this message by going to Community

Start a new discussion in jBPM Development at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100421/dd63bd81/attachment.html 

More information about the jboss-user mailing list