From c7772cbdd07a9584c84eb596fa290547f8e8b042 Mon Sep 17 00:00:00 2001 From: Vincenzo Ruffa Date: Wed, 30 May 2018 18:24:50 +0200 Subject: [PATCH] eq words count in email --- .../Controller/TranslatedConnectorController.php | 2 +- .../Microsoft/Utils/Email/ConfirmedQuotationEmail.php | 8 +++++++- .../Microsoft/Utils/Email/ErrorQuotationEmail.php | 6 ++++++ .../Microsoft/View/Emails/confirmed_quotation.html | 1 + lib/Features/Microsoft/View/Emails/error_quotation.html | 1 + 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/Features/Microsoft/Controller/TranslatedConnectorController.php b/lib/Features/Microsoft/Controller/TranslatedConnectorController.php index b993855..ef83fb1 100644 --- a/lib/Features/Microsoft/Controller/TranslatedConnectorController.php +++ b/lib/Features/Microsoft/Controller/TranslatedConnectorController.php @@ -45,7 +45,7 @@ public function sendJob() { $this->config = Microsoft::getConfig(); - $eq_word = \Jobs_JobDao::getEQWord($this->job); + $eq_word = \Jobs_JobDao::getTODOWords($this->job); $this->setSuccessMailSender( new ConfirmedQuotationEmail( Microsoft::getPluginBasePath() . '/Features/Microsoft/View/Emails/confirmed_quotation.html' ) ); $this->setFailureMailSender( new ErrorQuotationEmail( Microsoft::getPluginBasePath() . '/Features/Microsoft/View/Emails/error_quotation.html' ) ); diff --git a/lib/Features/Microsoft/Utils/Email/ConfirmedQuotationEmail.php b/lib/Features/Microsoft/Utils/Email/ConfirmedQuotationEmail.php index 8390f7f..1f4e683 100644 --- a/lib/Features/Microsoft/Utils/Email/ConfirmedQuotationEmail.php +++ b/lib/Features/Microsoft/Utils/Email/ConfirmedQuotationEmail.php @@ -18,6 +18,7 @@ class ConfirmedQuotationEmail extends AbstractEmail { protected $internal_project_id; protected $internal_job_id; protected $external_project_id; + protected $project_words_count; public function __construct( $templatePath ) { @@ -43,11 +44,16 @@ public function setExternalProjectId( $id ) { $this->external_project_id = $id; } + public function setProjectWordsCount( $count ) { + $this->project_words_count = $count; + } + protected function _getTemplateVariables() { return [ 'internal_project_id' => $this->internal_project_id, 'internal_job_id' => $this->internal_job_id, - 'external_project_id' => $this->external_project_id + 'external_project_id' => $this->external_project_id, + 'project_words_count' => $this->project_words_count, ]; } diff --git a/lib/Features/Microsoft/Utils/Email/ErrorQuotationEmail.php b/lib/Features/Microsoft/Utils/Email/ErrorQuotationEmail.php index e48fbc8..2df0540 100644 --- a/lib/Features/Microsoft/Utils/Email/ErrorQuotationEmail.php +++ b/lib/Features/Microsoft/Utils/Email/ErrorQuotationEmail.php @@ -20,6 +20,7 @@ class ErrorQuotationEmail extends AbstractEmail { protected $internal_project_id; protected $internal_job_id; protected $external_project_id; + protected $project_words_count; public function __construct( $templatePath ) { @@ -49,11 +50,16 @@ public function setExternalProjectId( $id ) { $this->external_project_id = $id; } + public function setProjectWordsCount( $count ) { + $this->project_words_count = $count; + } + protected function _getTemplateVariables() { return [ 'internal_project_id' => $this->internal_project_id, 'internal_job_id' => $this->internal_job_id, 'external_project_id' => $this->external_project_id, + 'project_words_count' => $this->project_words_count, 'message' => $this->message ]; } diff --git a/lib/Features/Microsoft/View/Emails/confirmed_quotation.html b/lib/Features/Microsoft/View/Emails/confirmed_quotation.html index 7ff9d1c..5154523 100644 --- a/lib/Features/Microsoft/View/Emails/confirmed_quotation.html +++ b/lib/Features/Microsoft/View/Emails/confirmed_quotation.html @@ -2,6 +2,7 @@

Project created successfully on Translated!

Matecat Project ID:

Matecat Job ID:

+

Words Count:


Translated Project ID:


diff --git a/lib/Features/Microsoft/View/Emails/error_quotation.html b/lib/Features/Microsoft/View/Emails/error_quotation.html index ff22dcd..6886bc2 100644 --- a/lib/Features/Microsoft/View/Emails/error_quotation.html +++ b/lib/Features/Microsoft/View/Emails/error_quotation.html @@ -2,6 +2,7 @@

Error in Project creation on Translated!

Matecat Project ID:

Matecat Job ID:

+

Words Count:


Error in HTS Confirm