Skip to content
Snippets Groups Projects
Commit 516d5bf0 authored by Johannes Goderbauer's avatar Johannes Goderbauer
Browse files

Email_lib: added missing comments

parent 3d0796c5
No related branches found
No related tags found
No related merge requests found
......@@ -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");
......
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