88f3e150 by acetousk

Add grapesjs email

1 parent 5430184b
......@@ -16,6 +16,31 @@ along with this software (see the LICENSE.md file). If not, see
<screen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/xml-screen-3.xsd">
<actions>
<entity-find-one entity-name="moqui.basic.email.EmailTemplate" value-field="emailTemplate" auto-field-map="[emailTemplateId:emailTemplateId]"/>
<entity-find-one entity-name="moqui.resource.DbResource" value-field="dbResource" auto-field-map="[resourceId:emailTemplate.resourceId]"/>
<!-- <log level="warn" message="dbResource ${dbResource}"/>-->
<if condition="!dbResource">
<return error="true" message="Resource not found"/>
</if>
<set field="actualDbResourcePath" from="null"/>
<set field="dbResourcePath" from="dbResource.filename"/>
<set field="lastDbResource" from="dbResource"/>
<!-- <log level="warn" message="lastDbResource ${lastDbResource}"/>-->
<script>
while (actualDbResourcePath == null) {
// ec.logger.warn('dbResourcePath: '+dbResourcePath)
if (lastDbResource.parentResourceId == null) {
dbResourcePath = 'dbresource://'+dbResourcePath
actualDbResourcePath = dbResourcePath
// ec.logger.warn('actualDbResourcePath: '+actualDbResourcePath)
} else {
lastDbResource = ec.entity.fastFindOne("moqui.resource.DbResource", true, false, lastDbResource.parentResourceId)
dbResourcePath = lastDbResource.filename+'/'+dbResourcePath
}
}
</script>
<set field="locationText" from="ec.resource.getLocationText(actualDbResourcePath)"/>
<log level="warn" message="GrapesJsEmail context.toString(): ${context.toString()}"/>
</actions>
......