Ver código fonte

Add Resend email support

Daniel Supernault 9 meses atrás
pai
commit
6cf4130ac2
4 arquivos alterados com 79 adições e 13 exclusões
  1. 1 0
      composer.json
  2. 58 1
      composer.lock
  3. 13 9
      config/mail.php
  4. 7 3
      config/services.php

+ 1 - 0
composer.json

@@ -37,6 +37,7 @@
 		"pragmarx/google2fa": "^8.0",
 		"predis/predis": "^2.0",
 		"pusher/pusher-php-server": "^7.2",
+		"resend/resend-php": "^0.13.0",
 		"spatie/laravel-backup": "^8.0.0",
 		"spatie/laravel-image-optimizer": "^1.8.0",
 		"stevebauman/purify": "^6.2.0",

+ 58 - 1
composer.lock

@@ -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": "fecc0efcc40880a422690feefedef584",
+    "content-hash": "0035325cb0240e92fc378e49f76447bd",
     "packages": [
         {
             "name": "aws/aws-crt-php",
@@ -6378,6 +6378,63 @@
             ],
             "time": "2024-04-27T21:32:50+00:00"
         },
+        {
+            "name": "resend/resend-php",
+            "version": "v0.13.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/resend/resend-php.git",
+                "reference": "c74926e34472fe3e3e21f150f3e3ce56fcbf8298"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/resend/resend-php/zipball/c74926e34472fe3e3e21f150f3e3ce56fcbf8298",
+                "reference": "c74926e34472fe3e3e21f150f3e3ce56fcbf8298",
+                "shasum": ""
+            },
+            "require": {
+                "guzzlehttp/guzzle": "^7.5",
+                "php": "^8.1.0"
+            },
+            "require-dev": {
+                "friendsofphp/php-cs-fixer": "^3.13",
+                "mockery/mockery": "^1.6",
+                "pestphp/pest": "^2.0"
+            },
+            "type": "library",
+            "autoload": {
+                "files": [
+                    "src/Resend.php"
+                ],
+                "psr-4": {
+                    "Resend\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Resend and contributors",
+                    "homepage": "https://github.com/resend/resend-php/contributors"
+                }
+            ],
+            "description": "Resend PHP library.",
+            "homepage": "https://resend.com/",
+            "keywords": [
+                "api",
+                "client",
+                "php",
+                "resend",
+                "sdk"
+            ],
+            "support": {
+                "issues": "https://github.com/resend/resend-php/issues",
+                "source": "https://github.com/resend/resend-php/tree/v0.13.0"
+            },
+            "time": "2024-08-15T03:27:29+00:00"
+        },
         {
             "name": "spatie/db-dumper",
             "version": "3.7.0",

+ 13 - 9
config/mail.php

@@ -37,8 +37,8 @@ return [
         'smtp' => [
             'transport' => 'smtp',
             'url' => env('MAIL_URL'),
-            'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
-            'port' => env('MAIL_PORT', 587),
+            'host' => env('MAIL_HOST', '127.0.0.1'),
+            'port' => env('MAIL_PORT', 2525),
             'encryption' => env('MAIL_ENCRYPTION', 'tls'),
             'username' => env('MAIL_USERNAME'),
             'password' => env('MAIL_PASSWORD'),
@@ -53,16 +53,21 @@ return [
 
         'mailgun' => [
             'transport' => 'mailgun',
-            // 'client' => [
-            //     'timeout' => 5,
-            // ],
+            'client' => [
+                'timeout' => 5,
+            ],
         ],
 
         'postmark' => [
             'transport' => 'postmark',
-            // 'client' => [
-            //     'timeout' => 5,
-            // ],
+            'message_stream_id' => env('POSTMARK_MESSAGE_STREAM_ID'),
+            'client' => [
+                'timeout' => 5,
+            ],
+        ],
+
+        'resend' => [
+            'transport' => 'resend',
         ],
 
         'sendmail' => [
@@ -82,7 +87,6 @@ return [
         'failover' => [
             'transport' => 'failover',
             'mailers' => [
-                'smtp',
                 'log',
             ],
         ],

+ 7 - 3
config/services.php

@@ -20,7 +20,7 @@ return [
     ],
 
     'ses' => [
-        'key'    => env('SES_KEY'),
+        'key' => env('SES_KEY'),
         'secret' => env('SES_SECRET'),
         'region' => env('SES_REGION', 'us-east-1'),
     ],
@@ -30,12 +30,16 @@ return [
     ],
 
     'stripe' => [
-        'model'  => App\User::class,
-        'key'    => env('STRIPE_KEY'),
+        'model' => App\User::class,
+        'key' => env('STRIPE_KEY'),
         'secret' => env('STRIPE_SECRET'),
     ],
 
     'expo' => [
         'access_token' => env('EXPO_ACCESS_TOKEN'),
     ],
+
+    'resend' => [
+        'key' => env('RESEND_KEY'),
+    ],
 ];