Browse Source

Utilisateurs : optin newsletter Souke

feature/rotating_product
Guillaume Bourgeois 8 months ago
parent
commit
b8949c654b
3 changed files with 30 additions and 3 deletions
  1. +2
    -2
      common/views/alert_message.php
  2. +26
    -0
      console/migrations/m240426_072033_add_column_user_newsletter.php
  3. +2
    -1
      domain/User/User/User.php

+ 2
- 2
common/views/alert_message.php View File

@@ -20,11 +20,11 @@ use yii\helpers\Html;
<?php endif; ?>
<?php if(is_array($message)): ?>
<?php foreach($message as $key => $mess): ?>
<?= nl2br(Html::encode($mess)); ?>
<?= nl2br($mess); ?>
<?php if($key !== array_key_last($message)): ?><br /><?php endif; ?>
<?php endforeach; ?>
<?php else: ?>
<?= nl2br(Html::encode($message)); ?>
<?= nl2br($message); ?>
<?php endif; ?>
</p>
</div>

+ 26
- 0
console/migrations/m240426_072033_add_column_user_newsletter.php View File

@@ -0,0 +1,26 @@
<?php

use yii\db\Migration;
use yii\db\Schema;

/**
* Class m240426_072033_add_column_user_newsletter
*/
class m240426_072033_add_column_user_newsletter extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->addColumn('user', 'newsletter_souke', Schema::TYPE_BOOLEAN.' DEFAULT 1');
}

/**
* {@inheritdoc}
*/
public function safeDown()
{
$this->dropColumn('user', 'newsletter_souke');
}
}

+ 2
- 1
domain/User/User/User.php View File

@@ -108,7 +108,7 @@ class User extends ActiveRecordCommon implements IdentityInterface
[['no_mail', 'mail_distribution_monday', 'mail_distribution_tuesday', 'mail_distribution_wednesday',
'mail_distribution_thursday', 'mail_distribution_friday', 'mail_distribution_saturday',
'mail_distribution_sunday', 'is_main_contact', 'newsletter', 'exclude_export_shopping_cart_labels',
'send_mail_welcome', 'trust_alert'], 'boolean'],
'send_mail_welcome', 'trust_alert', 'newsletter_souke'], 'boolean'],
[['lastname', 'name', 'phone', 'address', 'type', 'name_legal_person', 'evoliz_code', 'trust_alert_comment'], 'string'],
['lastname', 'verifyOneName', 'skipOnError' => false, 'skipOnEmpty' => false],
[['email', 'email_sending_invoicing_documents'], 'email', 'message' => 'Cette adresse email n\'est pas valide'],
@@ -157,6 +157,7 @@ class User extends ActiveRecordCommon implements IdentityInterface
'email_sending_invoicing_documents' => 'Email facturation',
'trust_alert' => 'Alerte confiance',
'trust_alert_comment' => 'Commentaire',
'newsletter_souke' => 'Infolettre Souke'
];
}


Loading…
Cancel
Save