@@ -10,16 +10,12 @@ class ProducerManager extends AbstractService implements ManagerInterface | |||
{ | |||
public function sendEmailNewProducer(Producer $producer): void | |||
{ | |||
\Yii::$app->mailer->compose( | |||
\Yii::$app->mailerService->sendAdmin( | |||
'Nouveau producteur', | |||
'new-producer', | |||
[ | |||
'html' => 'new-producer-html', | |||
'text' => 'new-producer-text' | |||
], [ | |||
'producer' => $producer | |||
]) | |||
->setTo(\Yii::$app->parameterBag->get('adminEmail')) | |||
->setFrom([\Yii::$app->parameterBag->get('adminEmail') => 'Opendistrib']) | |||
->setSubject('[Opendistrib] Nouveau producteur') | |||
->send(); | |||
'producer' => $producer | |||
] | |||
); | |||
} | |||
} |
@@ -5,7 +5,7 @@ use yii\db\Migration; | |||
class m190205_160337_produit_don_distrib extends Migration { | |||
public function up() { | |||
$this->insert('product', [ | |||
/*$this->insert('product', [ | |||
'name' => 'Don', | |||
'description' => 'Don à la plateforme distrib', | |||
'recipe' => '', | |||
@@ -24,10 +24,10 @@ class m190205_160337_produit_don_distrib extends Migration { | |||
'id_producer' => 0, | |||
'sale_mode' => 'unit', | |||
'order' => 1000, | |||
]) ; | |||
]);*/ | |||
} | |||
public function down() { | |||
$this->delete('product', 'name = \'Don\' AND id_producer = 0') ; | |||
//$this->delete('product', 'name = \'Don\' AND id_producer = 0') ; | |||
} | |||
} |
@@ -85,12 +85,12 @@ class PasswordResetRequestForm extends Model | |||
} | |||
if ($user->save()) { | |||
return \Yii::$app->mailer->compose(['html' => 'passwordResetToken-html', 'text' => 'passwordResetToken-text'], ['user' => $user]) | |||
->setFrom(['contact@opendistrib.net' => 'distrib']) | |||
->setTo($this->email) | |||
->setSubject('[Opendistrib] Mot de passe oublié') | |||
->send(); | |||
return \Yii::$app->mailerService->sendFromSite( | |||
'Mot de passe oublié', | |||
'passwordResetToken', | |||
['user' => $user], | |||
$this->email | |||
); | |||
} | |||
} | |||
@@ -239,7 +239,7 @@ class SignupForm extends Model | |||
if ($this->validate()) { | |||
$user = $userModule->instanciateUser(); | |||
$user = $userModule->instanciateUser(User::TYPE_INDIVIDUAL); | |||
$this->populateUser($user); | |||
if ($this->isProducer()) { |