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
By default, the `name` column will be used to set the recipient's name. If you wish to use something different, you should implement the `preferredEmailName` method in your model.
By default, the `email` column will be used to set the recipient's e-mail address. If you wish to use something different, you should implement the `preferredEmailAddress` method in your model.
You may schedule an e-mail by calling `later` instead of `send`. You must provide a Carbon instance or a strtotime valid date.
182
160
183
161
```php
184
-
<?php
185
-
186
-
use Stackkit\LaravelDatabaseEmails\Email;
187
-
188
162
Email::compose()
189
163
->later('+2 hours');
190
164
```
191
165
192
-
### Encryption (Optional)
166
+
### Queueing e-mails
167
+
168
+
> [!IMPORTANT]
169
+
> When queueing mail using the `queue` function, it is no longer necessary to schedule the `email:send` command.
193
170
194
-
If you wish to encrypt your e-mails, please enable the `encrypt` option in the configuration file. This is disabled by default. Encryption and decryption will be handled by Laravel's built-in encryption mechanism. Please note that by encrypting the e-mail it takes more disk space.
**Important**: When queueing mail using the `queue` function, it is no longer necessary to schedule the `email:send` command. Please make sure it is removed from `app/Console/Kernel.php`.
190
+
It could look like this:
216
191
217
192
```php
218
193
<?php
219
194
220
-
use Stackkit\LaravelDatabaseEmails\Email;
221
-
222
-
Email::compose()
223
-
->queue();
224
-
225
-
// on a specific connection
226
-
Email::compose()
227
-
->queue('sqs');
195
+
namespace App\Jobs;
228
196
229
-
// on a specific queue
230
-
Email::compose()
231
-
->queue(null, 'email-queue');
197
+
use Illuminate\Contracts\Queue\ShouldQueue;
198
+
use Stackkit\LaravelDatabaseEmails\SendEmailJob;
232
199
233
-
// timeout (send mail in 10 minutes)
234
-
Email::compose()
235
-
->queue(null, null, now()->addMinutes(10));
200
+
class CustomSendEmailJob extends SendEmailJob implements ShouldQueue
201
+
{
202
+
// Define custom retries, backoff, etc...
203
+
}
236
204
```
237
205
238
-
### Test mode (Optional)
206
+
### Test mode
239
207
240
208
When enabled, all newly created e-mails will be sent to the specified test e-mail address. This is turned off by default.
0 commit comments