diff --git a/setup.py b/setup.py
index 948bd0c..15ee518 100644
--- a/setup.py
+++ b/setup.py
@@ -42,6 +42,7 @@ setup(name='collective.dms.batchimport',
install_requires=[
'setuptools',
'collective.dms.basecontent',
+ 'collective.dms.mailcontent',
'collective.z3cform.datagridfield',
'five.grok',
],
diff --git a/src/collective/dms/batchimport/batchimport.py b/src/collective/dms/batchimport/batchimport.py
index 7c8951d..e4c776d 100644
--- a/src/collective/dms/batchimport/batchimport.py
+++ b/src/collective/dms/batchimport/batchimport.py
@@ -16,10 +16,10 @@ from plone.registry.interfaces import IRegistry
from plone.i18n.normalizer.interfaces import IIDNormalizer
from collective.z3cform.datagridfield import DataGridFieldFactory
from collective.z3cform.datagridfield.registry import DictRow
+from collective.dms.mailcontent.dmsmail import internalReferenceIncomingMailDefaultValue, receptionDateDefaultValue
from plone.app.registry.browser import controlpanel
-
from . import _
log = logging.getLogger('collective.dms.batchimport')
@@ -168,6 +168,10 @@ class BatchImporter(BrowserView):
else:
document_title = os.path.splitext(filename)[0].split('-', 1)[1]
+ if portal_type == 'dmsincomingmail':
+ metadata['internal_reference_no'] = internalReferenceIncomingMailDefaultValue(self)
+ metadata['reception_date'] = receptionDateDefaultValue(self)
+
log.info("creating the document for real (%s)" % document_id)
folder.invokeFactory(portal_type, id=document_id, title=document_title,
**metadata)
diff --git a/src/collective/dms/batchimport/configure.zcml b/src/collective/dms/batchimport/configure.zcml
index 728e061..1eb3999 100644
--- a/src/collective/dms/batchimport/configure.zcml
+++ b/src/collective/dms/batchimport/configure.zcml
@@ -8,6 +8,7 @@
+
diff --git a/src/collective/dms/batchimport/profiles/default/metadata.xml b/src/collective/dms/batchimport/profiles/default/metadata.xml
index 000197f..d42db31 100644
--- a/src/collective/dms/batchimport/profiles/default/metadata.xml
+++ b/src/collective/dms/batchimport/profiles/default/metadata.xml
@@ -1,4 +1,7 @@
0001
+
+ profile-collective.dms.mailcontent:default
+