Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
basic
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
xrm
basic
Commits
9c2e0253
Commit
9c2e0253
authored
5 years ago
by
Johannes Hörmann
Browse files
Options
Downloads
Patches
Plain Diff
Revert "try to generate eml from original eml"
This reverts commit
972bd6d4
parent
972bd6d4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
process/Bulkmail_lib/process.js
+390
-401
390 additions, 401 deletions
process/Bulkmail_lib/process.js
process/Email_lib/process.js
+7
-30
7 additions, 30 deletions
process/Email_lib/process.js
with
397 additions
and
431 deletions
process/Bulkmail_lib/process.js
+
390
−
401
View file @
9c2e0253
This diff is collapsed.
Click to expand it.
process/Email_lib/process.js
+
7
−
30
View file @
9c2e0253
...
...
@@ -61,15 +61,14 @@ EmailWritingUtils.getMailbridgeAddress = function ()
* object for handling emails
*
* @param {String|Array} [pToRecipients=[]] recipient email address or array of recipient email addresses
* @param {String} [pSender=
undefined
] email address of the sender
* @param {String} [pSubject=
undefined
] subject
* @param {String} [pBody=
undefined
] mail body
* @param {String} [pSender=
null
] email address of the sender
* @param {String} [pSubject=
null
] subject
* @param {String} [pBody=
null
] mail body
* @param {Array} [pCcRecipients=[]] array of recipient cc addresses
* @param {Array} [pBccRecipients=[]] array of recipient bcc addresses
* @param {String} [pOriginalRfcBase64=undefined] if existing, this file is used as base for creating an eml
* @class
*/
function
Email
(
pToRecipients
,
pSender
,
pSubject
,
pBody
,
pCcRecipients
,
pBccRecipients
,
pOriginalRfcBase64
)
function
Email
(
pToRecipients
,
pSender
,
pSubject
,
pBody
,
pCcRecipients
,
pBccRecipients
)
{
if
(
pToRecipients
&&
typeof
(
pToRecipients
)
==
"
string
"
)
pToRecipients
=
[
pToRecipients
];
...
...
@@ -80,7 +79,6 @@ function Email (pToRecipients, pSender, pSubject, pBody, pCcRecipients, pBccReci
this
.
toRecipients
=
pToRecipients
||
[];
this
.
ccRecipients
=
pCcRecipients
||
[];
this
.
bccRecipients
=
pBccRecipients
||
[];
this
.
originalRfc
=
pOriginalRfcBase64
;
}
/**
...
...
@@ -96,7 +94,7 @@ Email.fromRFC = function (pBase64RFC)
var
sender
=
mailData
[
mail
.
MAIL_SENDER
];
var
subject
=
mailData
[
mail
.
MAIL_SUBJECT
];
return
new
Email
(
null
,
sender
,
subject
,
body
,
undefined
,
undefined
,
pBase64RFC
);
return
new
Email
(
null
,
sender
,
subject
,
body
);
}
/**
...
...
@@ -114,18 +112,10 @@ Email.prototype.setTemplate = function (pTemplateId, pContactId, pBindata)
if
(
BulkMailUtils
.
isValidMimeType
(
pBindata
.
mimeType
))
{
template
=
new
DocumentTemplate
(
pBindata
.
bindata
,
DocumentTemplate
.
types
.
fromMimeType
(
pBindata
.
mimeType
),
pBindata
.
filename
,
true
);
this
.
originalRfc
=
pBindata
.
bindata
;
}
}
else
{
template
=
DocumentTemplate
.
loadTemplate
(
pTemplateId
);
if
(
BulkMailUtils
.
isValidTemplateType
(
template
.
type
))
{
this
.
originalRfc
=
template
.
content
;
}
}
var
email
=
template
.
getReplacedEmailsByContactIds
([
pContactId
])[
pContactId
];
this
.
sender
=
email
.
sender
;
this
.
body
=
email
.
body
;
...
...
@@ -174,31 +164,18 @@ Email.prototype.getMailtoUrl = function ()
*/
Email
.
prototype
.
getRFCmail
=
function
()
{
// disable generating mail via originalRfc for now as it doesn*t work as expected.
// --> undefined
this
.
originalRfc
=
undefined
var
ENCODING
=
"
UTF-8
"
;
var
mailId
;
var
originalRfcDecoded
=
this
.
originalRfc
?
util
.
decodeBase64String
(
this
.
originalRfc
)
:
null
;
logging
.
log
(
originalRfcDecoded
.
substr
(
0
,
300
));
try
{
if
(
originalRfcDecoded
)
mailId
=
mail
.
newMail
(
originalRfcDecoded
,
mail
.
FORMAT_MIME
);
else
mailId
=
mail
.
newMail
();
mailId
=
mail
.
newMail
();
}
catch
(
ex
)
{
//TODO: fix this dirty workaround [waiting for #1038963], since newMail causes an error on the first call after a user logged in
logging
.
log
(
ex
);
util
.
sleep
(
1500
);
if
(
originalRfcDecoded
)
mailId
=
mail
.
newMail
(
originalRfcDecoded
,
mail
.
FORMAT_MIME
);
else
mailId
=
mail
.
newMail
();
mailId
=
mail
.
newMail
();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment