Skip to content
Snippets Groups Projects
Commit c6105667 authored by S.Listl's avatar S.Listl
Browse files

Bulk mail fix

parent f103ddaf
No related branches found
No related tags found
No related merge requests found
import("Document_lib");
import("system.util");
import("system.result");
import("system.vars");
import("system.db");
import("DocumentTemplate_lib");
if (vars.get("$this.value") == null)
{
var upload = vars.get("$field.BINDATA");
var template;
if (upload)
{
var binData = DocumentUtil.getBindataFromUpload(upload);
var filename = DocumentUtil.getFilenameFromUpload(upload);
var type = DocumentUtil.getFileExtensionFromUpload(filename);
type = ({
"txt" : DocumentTemplate.types.TXT,
"html" : DocumentTemplate.types.HTML,
"htm" : DocumentTemplate.types.HTML,
"eml" : DocumentTemplate.types.EML
})[type];
template = new DocumentTemplate(binData, type);
}
else
{
template = DocumentTemplate.loadTemplate(vars.get("$field.DOCUMENTTEMPLATE_ID"));
}
var content = template.getReplacedContent({}, true);
result.string(content);
}
import("Document_lib");
import("system.util");
import("system.result");
import("system.vars");
import("system.db");
import("DocumentTemplate_lib");
if (!vars.get("$this.value"))
{
var upload = vars.get("$field.BINDATA");
var template;
if (upload)
{
var binData = DocumentUtil.getBindataFromUpload(upload);
var filename = DocumentUtil.getFilenameFromUpload(upload);
var type = DocumentUtil.getFileExtensionFromUpload(filename);
type = ({
"txt" : DocumentTemplate.types.TXT,
"html" : DocumentTemplate.types.HTML,
"htm" : DocumentTemplate.types.HTML,
"eml" : DocumentTemplate.types.EML
})[type];
template = new DocumentTemplate(binData, type);
}
else
{
template = DocumentTemplate.loadTemplate(vars.get("$field.DOCUMENTTEMPLATE_ID"));
}
var content = template.getReplacedContent({}, true);
result.string(content);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment