李帅

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",
......
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "c97a5197359075d72fd7f730e4caa9c2",
"content-hash": "7fe74b80f1988a671ddf33822eab5185",
"packages": [
{
"name": "asm89/stack-cors",
......@@ -1211,6 +1211,197 @@
"time": "2021-04-26T11:24:25+00:00"
},
{
"name": "google/apiclient",
"version": "v2.12.1",
"source": {
"type": "git",
"url": "https://github.com/googleapis/google-api-php-client.git",
"reference": "1530583a711f4414407112c4068464bcbace1c71"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/googleapis/google-api-php-client/zipball/1530583a711f4414407112c4068464bcbace1c71",
"reference": "1530583a711f4414407112c4068464bcbace1c71",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"firebase/php-jwt": "~2.0||~3.0||~4.0||~5.0",
"google/apiclient-services": "~0.200",
"google/auth": "^1.10",
"guzzlehttp/guzzle": "~5.3.3||~6.0||~7.0",
"guzzlehttp/psr7": "^1.7||^2.0.0",
"monolog/monolog": "^1.17||^2.0",
"php": "^5.6|^7.0|^8.0",
"phpseclib/phpseclib": "~2.0||^3.0.2"
},
"require-dev": {
"cache/filesystem-adapter": "^0.3.2|^1.1",
"composer/composer": "^1.10.22",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
"phpcompatibility/php-compatibility": "^9.2",
"phpspec/prophecy-phpunit": "^1.1||^2.0",
"phpunit/phpunit": "^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0",
"squizlabs/php_codesniffer": "~2.3",
"symfony/css-selector": "~2.1",
"symfony/dom-crawler": "~2.1",
"yoast/phpunit-polyfills": "^1.0"
},
"suggest": {
"cache/filesystem-adapter": "For caching certs and tokens (using Google\\Client::setCache)"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "2.x-dev"
}
},
"autoload": {
"files": [
"src/aliases.php"
],
"psr-4": {
"Google\\": "src/"
},
"classmap": [
"src/aliases.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"description": "Client library for Google APIs",
"homepage": "http://developers.google.com/api-client-library/php",
"keywords": [
"google"
],
"support": {
"issues": "https://github.com/googleapis/google-api-php-client/issues",
"source": "https://github.com/googleapis/google-api-php-client/tree/v2.12.1"
},
"time": "2021-12-02T03:34:25+00:00"
},
{
"name": "google/apiclient-services",
"version": "v0.299.0",
"source": {
"type": "git",
"url": "https://github.com/googleapis/google-api-php-client-services.git",
"reference": "cb6495dd548c6fc88133177fde3888ce9dcaabdd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/cb6495dd548c6fc88133177fde3888ce9dcaabdd",
"reference": "cb6495dd548c6fc88133177fde3888ce9dcaabdd",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=5.6"
},
"require-dev": {
"phpunit/phpunit": "^5.7||^8.5.13"
},
"type": "library",
"autoload": {
"files": [
"autoload.php"
],
"psr-4": {
"Google\\Service\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"description": "Client library for Google APIs",
"homepage": "http://developers.google.com/api-client-library/php",
"keywords": [
"google"
],
"support": {
"issues": "https://github.com/googleapis/google-api-php-client-services/issues",
"source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.299.0"
},
"time": "2023-05-06T01:04:14+00:00"
},
{
"name": "google/auth",
"version": "v1.26.0",
"source": {
"type": "git",
"url": "https://github.com/googleapis/google-auth-library-php.git",
"reference": "f1f0d0319e2e7750ebfaa523c78819792a9ed9f7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/f1f0d0319e2e7750ebfaa523c78819792a9ed9f7",
"reference": "f1f0d0319e2e7750ebfaa523c78819792a9ed9f7",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"firebase/php-jwt": "^5.5||^6.0",
"guzzlehttp/guzzle": "^6.2.1|^7.0",
"guzzlehttp/psr7": "^1.7|^2.0",
"php": "^7.1||^8.0",
"psr/cache": "^1.0|^2.0|^3.0",
"psr/http-message": "^1.0"
},
"require-dev": {
"guzzlehttp/promises": "0.1.1|^1.3",
"kelvinmo/simplejwt": "0.7.0",
"phpseclib/phpseclib": "^2.0.31||^3.0",
"phpspec/prophecy-phpunit": "^1.1||^2.0",
"phpunit/phpunit": "^7.5||^9.0.0",
"sebastian/comparator": ">=1.2.3",
"squizlabs/php_codesniffer": "^3.5"
},
"suggest": {
"phpseclib/phpseclib": "May be used in place of OpenSSL for signing strings or for token management. Please require version ^2."
},
"type": "library",
"autoload": {
"psr-4": {
"Google\\Auth\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"description": "Google Auth Library for PHP",
"homepage": "http://github.com/google/google-auth-library-php",
"keywords": [
"Authentication",
"google",
"oauth2"
],
"support": {
"docs": "https://googleapis.github.io/google-auth-library-php/main/",
"issues": "https://github.com/googleapis/google-auth-library-php/issues",
"source": "https://github.com/googleapis/google-auth-library-php/tree/v1.26.0"
},
"time": "2023-04-05T15:11:57+00:00"
},
{
"name": "graham-campbell/result-type",
"version": "v1.0.4",
"source": {
......@@ -3469,6 +3660,135 @@
"time": "2021-04-09T13:42:10+00:00"
},
{
"name": "paragonie/constant_time_encoding",
"version": "v2.6.3",
"source": {
"type": "git",
"url": "https://github.com/paragonie/constant_time_encoding.git",
"reference": "58c3f47f650c94ec05a151692652a868995d2938"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/58c3f47f650c94ec05a151692652a868995d2938",
"reference": "58c3f47f650c94ec05a151692652a868995d2938",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": "^7|^8"
},
"require-dev": {
"phpunit/phpunit": "^6|^7|^8|^9",
"vimeo/psalm": "^1|^2|^3|^4"
},
"type": "library",
"autoload": {
"psr-4": {
"ParagonIE\\ConstantTime\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Paragon Initiative Enterprises",
"email": "security@paragonie.com",
"homepage": "https://paragonie.com",
"role": "Maintainer"
},
{
"name": "Steve 'Sc00bz' Thomas",
"email": "steve@tobtu.com",
"homepage": "https://www.tobtu.com",
"role": "Original Developer"
}
],
"description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)",
"keywords": [
"base16",
"base32",
"base32_decode",
"base32_encode",
"base64",
"base64_decode",
"base64_encode",
"bin2hex",
"encoding",
"hex",
"hex2bin",
"rfc4648"
],
"support": {
"email": "info@paragonie.com",
"issues": "https://github.com/paragonie/constant_time_encoding/issues",
"source": "https://github.com/paragonie/constant_time_encoding"
},
"time": "2022-06-14T06:56:20+00:00"
},
{
"name": "paragonie/random_compat",
"version": "v9.99.100",
"source": {
"type": "git",
"url": "https://github.com/paragonie/random_compat.git",
"reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a",
"reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">= 7"
},
"require-dev": {
"phpunit/phpunit": "4.*|5.*",
"vimeo/psalm": "^1"
},
"suggest": {
"ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes."
},
"type": "library",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Paragon Initiative Enterprises",
"email": "security@paragonie.com",
"homepage": "https://paragonie.com"
}
],
"description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7",
"keywords": [
"csprng",
"polyfill",
"pseudorandom",
"random"
],
"support": {
"email": "info@paragonie.com",
"issues": "https://github.com/paragonie/random_compat/issues",
"source": "https://github.com/paragonie/random_compat"
},
"time": "2020-10-15T08:29:30+00:00"
},
{
"name": "phpoption/phpoption",
"version": "1.8.1",
"source": {
......@@ -3546,6 +3866,122 @@
"time": "2021-12-04T23:24:31+00:00"
},
{
"name": "phpseclib/phpseclib",
"version": "3.0.19",
"source": {
"type": "git",
"url": "https://github.com/phpseclib/phpseclib.git",
"reference": "cc181005cf548bfd8a4896383bb825d859259f95"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/cc181005cf548bfd8a4896383bb825d859259f95",
"reference": "cc181005cf548bfd8a4896383bb825d859259f95",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"paragonie/constant_time_encoding": "^1|^2",
"paragonie/random_compat": "^1.4|^2.0|^9.99.99",
"php": ">=5.6.1"
},
"require-dev": {
"phpunit/phpunit": "*"
},
"suggest": {
"ext-dom": "Install the DOM extension to load XML formatted public keys.",
"ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.",
"ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.",
"ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.",
"ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations."
},
"type": "library",
"autoload": {
"files": [
"phpseclib/bootstrap.php"
],
"psr-4": {
"phpseclib3\\": "phpseclib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jim Wigginton",
"email": "terrafrost@php.net",
"role": "Lead Developer"
},
{
"name": "Patrick Monnerat",
"email": "pm@datasphere.ch",
"role": "Developer"
},
{
"name": "Andreas Fischer",
"email": "bantu@phpbb.com",
"role": "Developer"
},
{
"name": "Hans-Jürgen Petrich",
"email": "petrich@tronic-media.com",
"role": "Developer"
},
{
"name": "Graham Campbell",
"email": "graham@alt-three.com",
"role": "Developer"
}
],
"description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.",
"homepage": "http://phpseclib.sourceforge.net",
"keywords": [
"BigInteger",
"aes",
"asn.1",
"asn1",
"blowfish",
"crypto",
"cryptography",
"encryption",
"rsa",
"security",
"sftp",
"signature",
"signing",
"ssh",
"twofish",
"x.509",
"x509"
],
"support": {
"issues": "https://github.com/phpseclib/phpseclib/issues",
"source": "https://github.com/phpseclib/phpseclib/tree/3.0.19"
},
"funding": [
{
"url": "https://github.com/terrafrost",
"type": "github"
},
{
"url": "https://www.patreon.com/phpseclib",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/phpseclib/phpseclib",
"type": "tidelift"
}
],
"time": "2023-03-05T17:13:09+00:00"
},
{
"name": "psr/cache",
"version": "3.0.0",
"source": {
......@@ -4322,6 +4758,147 @@
"time": "2021-09-25T23:10:38+00:00"
},
{
"name": "sendgrid/php-http-client",
"version": "3.14.4",
"source": {
"type": "git",
"url": "https://github.com/sendgrid/php-http-client.git",
"reference": "6d589564522be290c7d7c18e51bcd8b03aeaf0b6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sendgrid/php-http-client/zipball/6d589564522be290c7d7c18e51bcd8b03aeaf0b6",
"reference": "6d589564522be290c7d7c18e51bcd8b03aeaf0b6",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
"php": ">=5.6"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.16",
"phpunit/phpunit": "^5.7 || ^6.5",
"sebastian/version": "^1.0.6",
"squizlabs/php_codesniffer": "~2.0"
},
"suggest": {
"composer/ca-bundle": "Including this library will ensure that a valid CA bundle is available for secure connections"
},
"type": "library",
"autoload": {
"psr-4": {
"SendGrid\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Matt Bernier",
"email": "mbernier@twilio.com"
},
{
"name": "Elmer Thomas",
"email": "ethomas@twilio.com"
}
],
"description": "HTTP REST client, simplified for PHP",
"homepage": "http://github.com/sendgrid/php-http-client",
"keywords": [
"api",
"fluent",
"http",
"rest",
"sendgrid"
],
"support": {
"issues": "https://github.com/sendgrid/php-http-client/issues",
"source": "https://github.com/sendgrid/php-http-client/tree/3.14.4"
},
"time": "2022-03-09T20:21:55+00:00"
},
{
"name": "sendgrid/sendgrid",
"version": "7.11.5",
"source": {
"type": "git",
"url": "https://github.com/sendgrid/sendgrid-php.git",
"reference": "1d2fd3b72687fe82264853a8888b014f8f99e81f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sendgrid/sendgrid-php/zipball/1d2fd3b72687fe82264853a8888b014f8f99e81f",
"reference": "1d2fd3b72687fe82264853a8888b014f8f99e81f",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
"ext-openssl": "*",
"php": ">=5.6",
"sendgrid/php-http-client": "~3.10",
"starkbank/ecdsa": "0.*"
},
"replace": {
"sendgrid/sendgrid-php": "*"
},
"require-dev": {
"phpunit/phpunit": "^5.7.9 || ^6.4.3",
"squizlabs/php_codesniffer": "3.*",
"swaggest/json-diff": "^3.4"
},
"type": "library",
"autoload": {
"psr-4": {
"SendGrid\\Mail\\": "lib/mail/",
"SendGrid\\Stats\\": "lib/stats/",
"SendGrid\\Helper\\": "lib/helper/",
"SendGrid\\Contacts\\": "lib/contacts/",
"SendGrid\\EventWebhook\\": "lib/eventwebhook/"
},
"classmap": [
"lib/BaseSendGridClientInterface.php",
"lib/SendGrid.php",
"lib/TwilioEmail.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "This library allows you to quickly and easily send emails through Twilio SendGrid using PHP.",
"homepage": "http://github.com/sendgrid/sendgrid-php",
"keywords": [
"email",
"grid",
"send",
"sendgrid",
"twilio sendgrid"
],
"support": {
"issues": "https://github.com/sendgrid/sendgrid-php/issues",
"source": "https://github.com/sendgrid/sendgrid-php/tree/7.11.5"
},
"time": "2022-03-09T20:21:56+00:00"
},
{
"name": "socialiteproviders/apple",
"version": "5.0.3",
"source": {
......@@ -4867,6 +5444,55 @@
"time": "2021-12-18T20:33:51+00:00"
},
{
"name": "starkbank/ecdsa",
"version": "0.0.5",
"source": {
"type": "git",
"url": "https://github.com/starkbank/ecdsa-php.git",
"reference": "484bedac47bac4012dc73df91da221f0a66845cb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/starkbank/ecdsa-php/zipball/484bedac47bac4012dc73df91da221f0a66845cb",
"reference": "484bedac47bac4012dc73df91da221f0a66845cb",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=5.5"
},
"type": "library",
"autoload": {
"files": [
"src/ellipticcurve.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "StarkBank",
"email": "developers@starkbank.com",
"homepage": "https://starkbank.com",
"role": "Developer"
}
],
"description": "fast openSSL-compatible implementation of the Elliptic Curve Digital Signature Algorithm (ECDSA)",
"homepage": "https://github.com/starkbank/ecdsa-php",
"support": {
"issues": "https://github.com/starkbank/ecdsa-php/issues",
"source": "https://github.com/starkbank/ecdsa-php/tree/v0.0.5"
},
"time": "2021-06-06T22:24:49+00:00"
},
{
"name": "swiftmailer/swiftmailer",
"version": "v6.3.0",
"source": {
......@@ -10337,5 +10963,5 @@
"php": "^7.3|^8.0"
},
"platform-dev": [],
"plugin-api-version": "2.1.0"
"plugin-api-version": "2.3.0"
}
......