Step-by-Step Guide: Setting up Email Notifications for Laravel Contact Forms

preview_player
Показать описание
Get in touch with us.

Instagram: vicsystems
Github: vicsystems55

Prerequisite:
• SMTP Settings
• Laravel Project
• Contact Page with a contact form

Steps
1. Design the email template
2. Define what would be presented such as;
• Name of sender
• Email
• Message
• Phone
• Subject
3. Create an Email Class (ContactFormEmail)
4. Create a route, controller and method to post the data
5. Configure the Logic in the method to validate and collect information to be sent as mail
6. Implement the mail Façade and call the Mail Class just created
7. In the Mail Class Adjust the constructor
• To define the view
• Ser the data
• Edit subject

8. Back to the controller return back to the blade with a session message
9. Implement an if statement in the blade to check of r a session message and display it
10. In this example we used ”Thanks for reaching out. Your message has been sent successfully”
Рекомендации по теме
Комментарии
Автор

Apologies for the sound, we are making improvements.

vicsystems
Автор

You have made a mistake over there as assign the data variable in class and then point it in thet coinstructor using this but we have to add data as a parameter. so when ever we initialize the class so the actual data should be passed to trhe constrocter and then using this we ponit our data to the class levl data varaible.

korosukegaming