Toggle navigation
Toggle navigation
This project
Loading...
Sign in
OnePoem
/
OnePoem-Server
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
李帅
2023-05-12 10:00:26 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
52580ea1bef9d640c488c023c61051a831cb307e
52580ea1
1 parent
bb0ce89f
1.集成邮件发送
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
2 deletions
.env.example
app/Jobs/SendVerificationMessage.php
composer.json
composer.lock
.env.example
View file @
52580ea
...
...
@@ -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
...
...
app/Jobs/SendVerificationMessage.php
View file @
52580ea
...
...
@@ -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
());
}
}
}
...
...
composer.json
View file @
52580ea
...
...
@@ -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"
,
...
...
composer.lock
View file @
52580ea
This diff is collapsed. Click to expand it.
Please
register
or
login
to post a comment