2012-09-08 10:49:58 -05:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
*
|
2014-05-27 20:18:06 +02:00
|
|
|
* This file is part of the phpBB Forum Software package.
|
|
|
|
*
|
|
|
|
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
|
|
|
* @license GNU General Public License, version 2 (GPL-2.0)
|
|
|
|
*
|
|
|
|
* For full copyright and license information, please see
|
|
|
|
* the docs/CREDITS.txt file.
|
2012-09-08 10:49:58 -05:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2013-09-10 14:01:09 +02:00
|
|
|
namespace phpbb\notification\method;
|
|
|
|
|
2012-09-08 10:49:58 -05:00
|
|
|
/**
|
|
|
|
* Email notification method class
|
2012-09-08 13:40:05 -05:00
|
|
|
* This class handles sending emails for notifications
|
2012-09-08 10:49:58 -05:00
|
|
|
*/
|
2014-05-27 20:18:06 +02:00
|
|
|
|
2013-09-10 14:01:09 +02:00
|
|
|
class email extends \phpbb\notification\method\messenger_base
|
2012-09-08 10:49:58 -05:00
|
|
|
{
|
2012-11-09 07:40:08 -06:00
|
|
|
/**
|
|
|
|
* Get notification method name
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function get_type()
|
|
|
|
{
|
|
|
|
return 'email';
|
|
|
|
}
|
|
|
|
|
2012-09-08 17:48:13 -05:00
|
|
|
/**
|
|
|
|
* Is this method available for the user?
|
|
|
|
* This is checked on the notifications options
|
|
|
|
*/
|
2012-09-12 23:03:26 -05:00
|
|
|
public function is_available()
|
2012-09-08 13:40:05 -05:00
|
|
|
{
|
2013-03-17 19:54:32 +01:00
|
|
|
return $this->config['email_enable'] && $this->user->data['user_email'];
|
2012-09-08 13:40:05 -05:00
|
|
|
}
|
|
|
|
|
2012-10-18 19:13:47 -05:00
|
|
|
/**
|
|
|
|
* Parse the queue and notify the users
|
|
|
|
*/
|
2012-09-09 10:36:22 -05:00
|
|
|
public function notify()
|
2012-09-08 15:48:46 -05:00
|
|
|
{
|
2013-03-16 21:49:00 +01:00
|
|
|
return $this->notify_using_messenger(NOTIFY_EMAIL);
|
2012-09-08 15:48:46 -05:00
|
|
|
}
|
2012-09-08 10:49:58 -05:00
|
|
|
}
|