|
|
|
|
|
|
|
|
// user |
|
|
// user |
|
|
$user->id_etablissement = $etablissement->id ; |
|
|
$user->id_etablissement = $etablissement->id ; |
|
|
$user->status = User::STATUS_BOULANGER ; |
|
|
$user->status = User::STATUS_BOULANGER ; |
|
|
|
|
|
|
|
|
|
|
|
// envoi d'un email à l'administrateur pour le prévenir |
|
|
|
|
|
Yii::$app->mailer->compose( |
|
|
|
|
|
[ |
|
|
|
|
|
'html' => 'new-boulanger-html', |
|
|
|
|
|
'text' => 'new-boulanger-text' |
|
|
|
|
|
], |
|
|
|
|
|
[ |
|
|
|
|
|
'etablissement' => $etablissement |
|
|
|
|
|
]) |
|
|
|
|
|
->setTo(Yii::$app->params['adminEmail']) |
|
|
|
|
|
->setFrom([Yii::$app->params['adminEmail'] => 'La boîte à pain']) |
|
|
|
|
|
->setSubject('[La boîte à pain] Nouvelle boulangerie') |
|
|
|
|
|
->send(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$user->setPassword($this->password); |
|
|
$user->setPassword($this->password); |