add newsletter changes

This commit is contained in:
2016-05-26 08:50:10 +02:00
parent 07d5041126
commit 1fed67a650
16 changed files with 335 additions and 34 deletions

View File

@@ -285,6 +285,10 @@ class Helper {
return \Yii::$app->params ['company'] == 'movar';
}
public static function isCompanyGyor() {
return \Yii::$app->params ['company'] == 'gyor';
}
public static function isUserCartOn() {
return \Yii::$app->params ['user_cart_on'] == true;
}
@@ -392,5 +396,14 @@ class Helper {
return $randomString;
}
public static function getWebUrl(){
if ( self::isCompanyMovar()){
return "https://fitnessadmin.hu/fitness-web";
}else if ( self::isCompanyGyor()){
return "https://fitnessadmin.hu/cutler";
}else{
return "https://localhost/fitness-web";
}
}
}

View File

@@ -10,6 +10,8 @@ class WarnMailModel extends Model{
public $ticketTypeName;
public $ticketTypePriceBrutto;
public $customerName;
public $idCustomer;
public $newsletterToken;

View File

@@ -1,3 +1,8 @@
<?php
use yii\helpers\Html;
use yii\helpers\Url;
use common\components\Helper;
?>
<h1 style="font-size: 12px;">Kedves <?php echo $model->customerName?>!</h1>
<p style="font-size: 12px;">
Tájékoztatjuk, hogy az alábbi bérlete <?php echo $model->day?> nap múlva lejár:
@@ -13,6 +18,10 @@
<p style="font-size: 12px;">
<?php echo $model->company ?>
</p>
<p>
<?php $link = ( Helper::getWebUrl() ) . "/frontend/web/index.php?r=site/newsletter-subscribe&id=".$model->idCustomer."&token=".$model->newsletterToken; ?>
<?php //echo Html::a("Szeretnék hírlevelet kapni", $link )?>
</p>
<p>
Ez egy automatikus e-mail üzenet, amelyre nem tud válaszolni.
</p>

View File

@@ -43,6 +43,9 @@ class Log extends BaseFitnessActiveRecord
public static $TYPE_PROCUREMENT_UPDATE = 80;
public static $TYPE_TICKET_COUNT_MOVE_OUT = 90;
public static $TYPE_WASTE = 100;
public static $TYPE_NEWSLETTER_SUBSCRIBE = 110;
public static $TYPE_NEWSLETTER_UNSUBSCRIBE = 120;
/**
* @inheritdoc
*/
@@ -110,4 +113,15 @@ class Log extends BaseFitnessActiveRecord
$model->save(false);
}
/**
* create a log from the console app
* */
public static function logC( $config ){
$model = new Log($config);
$model->app = "Fitness rendszer";
$model->url = "console";
$model->id_user = 1;
$model->save(false);
}
}