Skip to content
Snippets Groups Projects
Commit 2f2451ed authored by Benjamin Ulrich's avatar Benjamin Ulrich :speech_balloon:
Browse files

[Projekt: Entwicklung - Neon][TicketNr.: 1062998][Angebot - Angebot anzeigen -...

[Projekt: Entwicklung - Neon][TicketNr.: 1062998][Angebot - Angebot anzeigen - als Email versenden - Status versendet wird zu früh gesetzt]
parent c5427624
No related branches found
No related tags found
No related merge requests found
......@@ -128,6 +128,12 @@
<name>AdditionalPlaceholders_param</name>
<expose v="true" />
</entityParameter>
<entityParameter>
<name>OfferId_param</name>
<expose v="true" />
<mandatory v="true" />
<documentation>%aditoprj%/entity/Email_entity/entityfields/offerid_param/documentation.adoc</documentation>
</entityParameter>
</entityFields>
<recordContainers>
<datalessRecordContainer>
......
=OfferId_pram
optional param needed for the offerEmails, to change the status of the offer
\ No newline at end of file
import("KeywordRegistry_basic");
import("Sql_lib");
import("system.translate");
import("ActivityTask_lib");
import("system.neon");
......@@ -38,6 +40,11 @@ var eml = EmailWritingUtils.openMailTemplate(
additionalPlaceholders
);
if(vars.get("$param.ComingFrom_param") == "Offer")
{
newWhere("OFFER.OFFERID", vars.get("$param.OfferId_param"))
.updateData(true, "OFFER", ["STATUS"], null, [$KeywordRegistry.offerStatus$sent()]);
}
if (notificationMsg)
question.showMessage(notificationMsg, question.INFORMATION, notificationTitle);
\ No newline at end of file
......@@ -27,9 +27,5 @@ attachmentArray[0] = offerReport;
var additionalPlaceholders = [
new Placeholder("offerCode", Placeholder.types.FIXEDVALUE, vars.get("$field.FullOfferCode"))
];
EmailWritingUtils.sendReportAsMail(contactId, attachmentArray, "Offer", notificationMsg, emailFilename, additionalPlaceholders);
newWhere("OFFER.OFFERID", "$field.OFFERID")
.updateData(true, "OFFER", ["STATUS"], null, [$KeywordRegistry.offerStatus$sent()]);
var offerId = vars.get("$field.OFFERID")
EmailWritingUtils.sendReportAsMail(contactId, attachmentArray, "Offer", notificationMsg, emailFilename, additionalPlaceholders, offerId);
\ No newline at end of file
......@@ -78,8 +78,9 @@ EmailWritingUtils.openMailTemplate = function (pToRecipients, pSenderContactId,
* @param {String} pComingFrom source from where you started (e.g. "Person", "Organisation" )
* @param {String} pEmailFilename optional file name of the email.
* @param {String} [pAdditionalPlaceholders] additional placeholders for the email
* @param {String} [pOfferId] optional needed for the offerEmails, to change the status of the offer
*/
EmailWritingUtils.openNewMail = function (pToContactId, pToEmailAddress, pComingFrom, pAttachmentArray, pNotificationMsg, pEmailFilename, pAdditionalPlaceholders)
EmailWritingUtils.openNewMail = function (pToContactId, pToEmailAddress, pComingFrom, pAttachmentArray, pNotificationMsg, pEmailFilename, pAdditionalPlaceholders, pOfferId)
{
var params = {
"ContactId_param" : pToContactId,
......@@ -87,7 +88,8 @@ EmailWritingUtils.openNewMail = function (pToContactId, pToEmailAddress, pComing
"ComingFrom_param" : pComingFrom,
"NotificationMsg_param" : pNotificationMsg,
"EmailFilename" : pEmailFilename,
"AdditionalPlaceholders_param" : JSON.stringify(pAdditionalPlaceholders)
"AdditionalPlaceholders_param" : JSON.stringify(pAdditionalPlaceholders),
"OfferId_param" : pOfferId
};
if (pToEmailAddress)
......@@ -111,14 +113,15 @@ EmailWritingUtils.getMailbridgeAddress = function ()
* @param {String} pNotificationMsg message which will be shown after the operation is done.
* @param {String} pEmailFilename optional file name of the email.
* @param {String} [pAdditionalPlaceholders] additional placeholders for the email
* @param {String} [pOfferId] optional needed for the offerEmails, to change the status of the offer
* Report have to be a object with these attrs: content (base64 encoded report), contentType (mimeType of the report), filename (complete filename with filending)
*/
EmailWritingUtils.sendReportAsMail = function (pRecipient, pReportArray, pComingFrom, pNotificationMsg, pEmailFilename, pAdditionalPlaceholders)
EmailWritingUtils.sendReportAsMail = function (pRecipient, pReportArray, pComingFrom, pNotificationMsg, pEmailFilename, pAdditionalPlaceholders, pOfferId)
{
var pRecpientEmail = newSelect("COMMUNICATION.ADDR").from("COMMUNICATION")
.where("COMMUNICATION.CONTACT_ID", pRecipient).and("COMMUNICATION.MEDIUM_ID", "COMMEMAIL").cell();
EmailWritingUtils.openNewMail(pRecipient, pRecpientEmail, pComingFrom, pReportArray, pNotificationMsg, pEmailFilename, pAdditionalPlaceholders);
EmailWritingUtils.openNewMail(pRecipient, pRecpientEmail, pComingFrom, pReportArray, pNotificationMsg, pEmailFilename, pAdditionalPlaceholders, pOfferId);
}
/**
......
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