|
|
@@ -10,26 +10,19 @@ class Email
|
|
|
* @param string $email
|
|
|
* @param string $userName
|
|
|
* @param string $password
|
|
|
- * @return bool
|
|
|
*/
|
|
|
- public static function sendRegistrationEmail(string $email, string $userName, string $password): bool
|
|
|
+ public static function sendRegistrationEmail(string $email, string $userName, string $password)
|
|
|
{
|
|
|
$subject = 'Elken Welcome You.';
|
|
|
$message = \Yii::t('app', 'welcomeEmail', ['userName' => $userName, 'passWord' => $password]);
|
|
|
|
|
|
$mailer = Yii::$app->mailer;
|
|
|
$mailer->useFileTransport = false;
|
|
|
- $response = $mailer->compose()
|
|
|
-// ->setFrom([Yii::$app->params['adminEmail'] => 'elken'])
|
|
|
+ $mailer->compose()
|
|
|
->setFrom('eshop-noreply@elken.com')
|
|
|
-// ->setFrom('18511880790@163.com')
|
|
|
- ->setTo('kevin@elken.com')
|
|
|
+ ->setTo($email)
|
|
|
->setSubject($subject)
|
|
|
->setHtmlBody($message)
|
|
|
->send();
|
|
|
-
|
|
|
- LoggerTool::debug(['email', $response]);
|
|
|
-
|
|
|
- return true;
|
|
|
}
|
|
|
}
|