Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
moqui
/
moqui-mjml
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
bced5dd3
authored
11 months ago
by
acetousk
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Fix Email with new locations from EmailTemplate
1 parent
cba2b9ba
master
...
BF-11979
use-raw-ftl-not-temp-dbresource
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
24 deletions
screen/emails/GrapesJsEmail.xml
screen/emails/GrapesJsEmail.xml
View file @
bced5dd
...
...
@@ -17,32 +17,11 @@ along with this software (see the LICENSE.md file). If not, see
<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
condition=
"!emailTemplate"
>
<return
error=
"true"
message=
"Email Template 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=
"htmlDbResourcePath"
from=
"actualDbResourcePath - '.json' + '.html'"
/>
<set
field=
"renderedText"
from=
"ec.resource.template(htmlDbResourcePath, 'ftl')"
/>
<
log
level=
"warn"
message=
"GrapesJsEmail context.toString(): ${context.toString()}
"
/>
<
set
field=
"renderedText"
from=
"ec.resource.template(emailTemplate.htmlLocation, 'ftl')
"
/>
</actions>
<widgets>
...
...
This diff is collapsed.
Click to expand it.
Please
register
or
sign in
to post a comment