李帅

1.集成邮件发送

......@@ -50,3 +50,5 @@ PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
SENDGRID_API_KEY=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
\ No newline at end of file
......
......@@ -44,8 +44,7 @@ class SendVerificationMessage implements ShouldQueue
$redis->setex($this->email,1800,$code); //过期时间30分钟
$api = 'http://api.sendcloud.net/apiv2/mail/sendtemplate';
/*$api = 'http://api.sendcloud.net/apiv2/mail/sendtemplate';
$API_USER = 'mofunsky_noreply';
$API_KEY = '8EkR0XnMuJn6V5yQ';
$from = 'noreply@yiyan.pub';
......@@ -81,7 +80,21 @@ class SendVerificationMessage implements ShouldQueue
// 用开发模板发送。
Mail::to($this->email)->send(new SendVerifyCode($code));
}*/
$email = new \SendGrid\Mail\Mail();
$email->setFrom("hello@parlando.ink", "Parlando");
$email->addTo($this->email, "Parlando User");
$email->addContent(
"text/html", "Please enter in the verification code input box: <strong>$code</strong><br/>(The code will expire in 30 minutes.)"
);
$sendgrid = new \SendGrid(env('SENDGRID_API_KEY'));
try {
$sendgrid->send($email);
} catch (\Exception $e) {
Log::channel("daily")->error("send email error :".$e->getMessage());
}
}
}
......
......@@ -18,6 +18,7 @@
"laravel/sanctum": "^2.11",
"laravel/socialite": "^5.2",
"laravel/tinker": "^2.5",
"sendgrid/sendgrid": "~7",
"socialiteproviders/apple": "^5.0",
"socialiteproviders/facebook": "^4.1",
"socialiteproviders/github": "^4.1",
......
This diff is collapsed. Click to expand it.