Extend Notification Send (email) functionality
I tried a form in settings which defines a email settings like smtp host etc.. and I succeeded in that but I want to extend send functionality in notification library. Can anyone give some idea on this this is my first day with fuelcms.
Comments
"Send new user invite" functionality I wanted to extend.
i.e. there is a form created via new module in settings for email settings which covers the fields like all email settings .. (from name, smtp, email etc...) which will be used to send email when the send function of file > modules\fuel\libraries\Fuel_notification.php is called.
For that purpose I need to extend this library, but failed to do this. Just needed some guide/tips for this kind of functionality.
Thanks.
$my_notification = new MY_Notification(); $CI->fuel->attach('notification', $my_notification);
I think I am getting very noob here.
Let me explain my issue.
Final Goal:
When resetpassword/new invite is called it should also send email to admin who has different smtp details. So, I want to extend it.
What I did:
I have created a file in \application\libraries\MY_Notification.php which starts like...
require_once(FUEL_PATH.'libraries/Fuel_notification.php');
class My_notification extends Fuel_notification
and this new file also do have a send function just like modules\fuel\libraries\Fuel_notification.php file has one.
Now I was hoping that when send function is triggered, it will call from My_notification function and which is not getting called for obvious reason.
But I am not getting how to solve it.
$my_notification = new MY_Notification(); $CI->fuel->attach('notification', $my_notification);
- that is the wrong location of the code
- and there will/should not be any changes in Fuel_notification.php.
$config['attach'] = array('notification' => new MY_Notification());