You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+38-4Lines changed: 38 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,17 +54,48 @@ MAILJET_APIKEY=YOUR_APIKEY
54
54
MAILJET_APISECRET=YOUR_APISECRET
55
55
```
56
56
57
+
## Full configuration
58
+
59
+
```php
60
+
'mailjet' => [
61
+
'key' => env('MAILJET_APIKEY'),
62
+
'secret' => env('MAILJET_APISECRET'),
63
+
'transactionnal' => [
64
+
'call' => true,
65
+
'options' => [
66
+
'url' => 'api.mailjet.com',
67
+
'version' => 'v31',
68
+
'call' => true,
69
+
'secured' => true
70
+
]
71
+
],
72
+
'common' => [
73
+
'call' => true,
74
+
'options' => [
75
+
'url' => 'api.mailjet.com',
76
+
'version' => 'v3',
77
+
'call' => true,
78
+
'secured' => true
79
+
]
80
+
]
81
+
]
82
+
```
83
+
You can pass settings to [MailjetClient](https://github.com/mailjet/mailjet-apiv3-php#new--version-120-of-the-php-wrapper-).
84
+
85
+
*`transactionnal`: settings to sendAPI client
86
+
*`common`: setting to MailjetClient accessible throught the Facade Mailjet
87
+
57
88
## Mail driver configuration
58
89
59
-
In order to use Mailjet as Mail driver, you need to change the mail driver in your `config/mail.php` or your `.env` file to `mailjet`, and make sure you have a valid and authorised from-address configured.
90
+
In order to use Mailjet as Mail driver, you need to change the mail driver in your `config/mail.php` or your `.env` file to `MAIL_DRIVER=mailjet`, and make sure you have a valid and authorised from-address configured on your Mailjet account.
60
91
61
92
For usage, check the [Laravel mail documentation](https://laravel.com/docs/master/mail)
62
93
63
94
## Usage
64
95
65
96
To use it, you need to import Mailjet Facade in your file
66
97
67
-
use Mailjet;
98
+
use Mailjet\LaravelMailjet\Facades\Mailjet;
68
99
69
100
70
101
Then, in your code you can use one of the method available in the MailjetServices :
@@ -88,8 +119,11 @@ High level API methods:
88
119
89
120
For more informations about the filters you can use in each methods, refer to the [Mailjet API documentation](https://dev.mailjet.com/email-api/v3/apikey/)
90
121
122
+
All method return the data array or throw a MailjetException in case of API error.
123
+
124
+
You can also get the client with the method `getClient()` and make your own request to Mailjet API.
91
125
92
126
## ToDo
93
127
94
-
*Client Call/Options (common api call and transactionnal mail)
0 commit comments