Skip to content

Commit

Permalink
Refactoring. Moved classes in the MateCat Main code
Browse files Browse the repository at this point in the history
  • Loading branch information
Ostico committed Jun 7, 2018
1 parent dd4bb7c commit 1880a42
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 128 deletions.
62 changes: 1 addition & 61 deletions lib/Features/Microsoft/Utils/Email/ConfirmedQuotationEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,66 +12,6 @@
use Features\Microsoft;
use INIT;

class ConfirmedQuotationEmail extends AbstractEmail {
class ConfirmedQuotationEmail extends \Features\Outsource\Email\ConfirmedQuotationEmail {

protected $title = 'Confirmed Quotation';
protected $internal_project_id;
protected $internal_job_id;
protected $external_project_id;
protected $project_words_count;


public function __construct( $templatePath ) {

$this->_setLayout( 'skeleton.html' );
$this->_setTemplateByPath( $templatePath );
}

public function send() {
$config = Microsoft::getConfig();
$this->sendTo( $config[ 'success_quotation_email_address' ], "Translated Team" );
}

public function setInternalIdProject( $id ) {
$this->internal_project_id = $id;
}

public function setInternalJobId( $id ) {
$this->internal_job_id = $id;
}

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,
];
}

protected function _getLayoutVariables() {
$vars = parent::_getLayoutVariables();
$vars[ 'title' ] = $this->title;

return $vars;
}


protected function _getDefaultMailConf() {
$mailConf = parent::_getDefaultMailConf();

$mailConf[ 'from' ] = INIT::$MAILER_RETURN_PATH;
$mailConf[ 'sender' ] = INIT::$MAILER_RETURN_PATH;
$mailConf[ 'returnPath' ] = INIT::$MAILER_RETURN_PATH;

return $mailConf;
}
}
68 changes: 1 addition & 67 deletions lib/Features/Microsoft/Utils/Email/ErrorQuotationEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,72 +13,6 @@
use Features\Microsoft;
use INIT;

class ErrorQuotationEmail extends AbstractEmail {
class ErrorQuotationEmail extends \Features\Outsource\Email\ErrorQuotationEmail {

protected $title = 'Project creation went in error';
protected $message;
protected $internal_project_id;
protected $internal_job_id;
protected $external_project_id;
protected $project_words_count;


public function __construct( $templatePath ) {

$this->_setLayout( 'skeleton.html' );
$this->_setTemplateByPath( $templatePath );
}

public function send() {
$config = Microsoft::getConfig();
$this->sendTo( $config[ 'error_quotation_email_address' ], "Translated Team" );
}

public function setErrorMessage( $message ) {
$this->message = $message;
}

public function setInternalIdProject( $id ) {
$this->internal_project_id = $id;
}

public function setInternalJobId( $id ) {
$this->internal_job_id = $id;
}

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
];
}

protected function _getLayoutVariables() {
$vars = parent::_getLayoutVariables();
$vars[ 'title' ] = $this->title;

return $vars;
}


protected function _getDefaultMailConf() {
$mailConf = parent::_getDefaultMailConf();

$mailConf[ 'from' ] = INIT::$MAILER_RETURN_PATH;
$mailConf[ 'sender' ] = INIT::$MAILER_RETURN_PATH;
$mailConf[ 'returnPath' ] = INIT::$MAILER_RETURN_PATH;

return $mailConf;
}
}

0 comments on commit 1880a42

Please sign in to comment.