From 516d5bf041278bfaf077259c0c3214a0da360dc4 Mon Sep 17 00:00:00 2001 From: "j.goderbauer" <j.goderbauer@adito.de> Date: Tue, 28 May 2019 12:05:50 +0200 Subject: [PATCH] Email_lib: added missing comments --- process/Email_lib/process.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/process/Email_lib/process.js b/process/Email_lib/process.js index 837f3b9610..c1e2613524 100644 --- a/process/Email_lib/process.js +++ b/process/Email_lib/process.js @@ -8,6 +8,16 @@ import("system.mail"); function EmailUtils () {} +/** + * creates a new E-Mail-Object and ask for a download of a eml where all fields are prefilled + * The eml can be open with a mailclient and sent via the mailclient. Each mailclient has a different behaviour: + * In Outlook the mail is automatically opened in draft-mode + * In Thunderbird the mail is opened in view mode and you've to manually "edit as new" + * + * @param {String|Array} pToRecipients mailaddresses of the recipients, can either be a 1D-Array with several addresses or a string with one address + * @param {String} pContactId contactId of the sender. the standard mailadress of the contact is used as sender-address + * @param {String} [pTemplateId] if a document-template shall be used, give the templateId here + */ EmailUtils.openMailTemplate = function (pToRecipients, pContactId, pTemplateId) { var email = new Email(pToRecipients); @@ -18,6 +28,11 @@ EmailUtils.openMailTemplate = function (pToRecipients, pContactId, pTemplateId) email.downloadEML(); } +/** + * opens a view where a new mail can be sent. In the view the use CAN select a DocumentTemplate if needed + * + * @param {String} pToContactId contactId with contacts to filter the communication-addresses + */ EmailUtils.openNewMail = function (pToContactId) { var params = { @@ -153,6 +168,9 @@ Email.prototype.openMail = function () neon.openUrl(this.getMailtoUrl(), false); } +/** + * ask for a download of the email + */ Email.prototype.downloadEML = function() { neon.download(util.encodeBase64String(this.getRFCmail(), null), (this.subject || translate.text("Email Template")) + ".eml"); -- GitLab