Sending Email with laravel notification (Check description for .env file settings)

Published: 08 January 2021
on channel: Code Combination
420
1

Hello,
In this video we will send notification email to user (student),
When student data is removed we will send email notifying him that he/she has been struck from school.
------------------------------------------------------------------------------------------------------------------------
Additions: We have added email column in our project that will be students emails
------------------------------------------------------------------------------------------------------------------------
You can send email notification whatever scenario you have designed
-------------------------------------------------------------------------------------------------------------------
Note: This video is only for code part and settings for .env file are mentioned in description
Settings for env file:
We are sending email with send grid
1) Visit https://sendgrid.com/
2) create account for free with the email you want to send emails with
3)On the left side bar go to bottom there will be settings tab click it and select API KEYS tab from there
4) Click on create Api key
5) save the generated key and the name
6)Now go to settings tab again and go to tab SENDER AUTHENTICATION
7)After clicking it select, Single Sender Verification and give the email from which you want to send emails then go to that email and verify
8) Finally go to .env file in your project and set these credientials from sendgrid that you just did in early steps


MAIL_MAILER=smtp
MAIL_HOST=smtp.sendgrid.net
MAIL_PORT=587
MAIL_USERNAME=username you set in api key creation
MAIL_PASSWORD= API KEY that was generated it will be in encrypted form hint: step 4,5
MAIL_ENCRYPTION=TLS
MAIL_FROM_ADDRESS=the email address that we set in sender authentication in step 7
MAIL_FROM_NAME=Codecombination

Serve the project and we are ready to go

Kindly, place 'new' inside brackets
Note::
If you get error in notification then replace MailMessage::class with MailMessage


Watch video Sending Email with laravel notification (Check description for .env file settings) online without registration, duration hours minute second in high quality. This video was added by user Code Combination 08 January 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 420 once and liked it 1 people.