laravelista / comments

Native comments for your Laravel application.
MIT License
744 stars 142 forks source link

please add: send notify email me when someone leave a new comments #137

Closed edge104 closed 3 years ago

edge104 commented 3 years ago

This tool is very easy to use, super awesome!👍 It would be more complete if you can send a letter to notify when someone leaves a message :-)

mabasic commented 3 years ago

You can watch for event CommentCreated and then send an email or do whatever else you want.

I do not want to add that to the package atm because then I would have to maintain the email design and email class etc.

edge104 commented 3 years ago

You can watch for event CommentCreated and then send an email or do whatever else you want.

I do not want to add that to the package atm because then I would have to maintain the email design and email class etc.

thanks. i'll try it

eduardonwa commented 3 years ago

Could you make a tutorial about this? Thanks!

mabasic commented 3 years ago

Could you make a tutorial about this? Thanks!

@eduardonwa Take a look at the Laravel documentation for events here: https://laravel.com/docs/8.x/events#introduction

It is very well explained in the docs but if that is not enough I am sure that laracasts has a few tutorials for listening to events.

edge104 commented 3 years ago

does event CommentCreated refer to this file? vendor\laravelista\comments\src\Events\CommentCreated.php

but how could I customize this file? I mean how to copy this file to my project directory to modify

or should I copy CommentController.php in vendor to my project directory then change controller file path in config/comments.php
and I add mail::send() action to CommentController.php?

mabasic commented 3 years ago

@edge104 You should add a listener to your project which will trigger when the event CommentCreated is dispatched. See the Laravel documentation for specifics.