https://github.com/romanturas/customize-email-laravel
Customize email in Laravel 8
https://github.com/romanturas/customize-email-laravel
Last synced: about 1 year ago
JSON representation
Customize email in Laravel 8
- Host: GitHub
- URL: https://github.com/romanturas/customize-email-laravel
- Owner: RomanTuras
- Created: 2021-06-24T04:12:13.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-24T04:53:04.000Z (about 5 years ago)
- Last Synced: 2025-02-14T07:37:59.168Z (over 1 year ago)
- Language: PHP
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# How to customize email notifications in Laravel 8
### Generate class app/Notifications/NotifyUser.php
```
php artisan make:notification NotifyUser
```
### For use this NotifyUser class open a User model and add:
```php
public function sendPasswordResetNotification($token)
{
$this->notify(new NotifyUser($token));
}
```
### In my case, I store translate messages in the:
_resources/lang/\_en/passwords.php_
### For publish the email templates:
```
php artisan vendor:publish --tag=laravel-notifications
```
_Result is: resources/views/vendor/notifications/email.blade.php_
### For publish all components:
```
php artisan vendor:publish --tag=laravel-mail
```
_The result will be in: /resources/views/vendor/mail_
### At last, for change a theme of email notification, go to:
_config/mail.php_
### and change the default theme
---
## For setup sending mail, open .env and
- change all founding `127.0.0.1` to `localhost`
- setup mail settings:
```
MAIL_MAILER=smtp
MAIL_HOST=smtp.nei**ica.com
MAIL_PORT=587
MAIL_USERNAME=info@nei**ica.com
MAIL_PASSWORD=***
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=info@nei**ica.com
MAIL_FROM_NAME="${APP_NAME}"
```