I rigged up a test of sendEmailTemplate by putting this in a transition:
<actions>
<!--
<service-call name="org.moqui.impl.UserServices.reset#Password"/>
-->
<service-call name="org.moqui.impl.EmailServices.send#EmailTemplate">
<field-map field-name="emailTemplateId" value="PASSWORD_RESET"/>
<field-map field-name="toAddresses" value="test@gmail.com"/>
<field-map field-name="bodyParameters" from="[userAccount:userAccount, newPassword: 'xxxxxxx']"/>
</service-call>
...
and I end up with this error: java.lang.NullPointerException: Cannot execute null+null at org.codehaus.groovy.runtime.NullObject.plus(NullObject.java:121) ... at org.moqui.impl.context.WebFacadeImpl.getWebappRootUrl(WebFacadeImpl.groovy:272)
because both webappName and servletContextPath are null.
This comes from the text render in sendEmailTemplate (ln 77) so webappName is not set as it is in the call right above.
But all of this misses the point - I think. I think the error is in ScreenUrlInfo (~ln 450):
if (sri.baseLinkUrl) {
baseUrl = sri.baseLinkUrl
if (baseUrl && baseUrl.charAt(baseUrl.length()-1) == '/') baseUrl.substring(0, baseUrl.length()-1)
} else {
baseUrl = WebFacadeImpl.getWebappRootUrl(sri.webappName, sri.servletContextPath, true,
this.requireEncryption, (ExecutionContextImpl) ec)
}
sri.baseLinkUrl is not set and I think that is the problem. Where should sri.baseLinkUrl be being set?