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?