| 1 |
<?php |
| 2 |
/** |
| 3 |
* New event email class |
| 4 |
* |
| 5 |
* @package Timetics |
| 6 |
*/ |
| 7 |
namespace Timetics\Core\Emails; |
| 8 |
|
| 9 |
use Timetics\Core\Staffs\Staff; |
| 10 |
|
| 11 |
class Re_Invite_Staff extends Email { |
| 12 |
|
| 13 |
/** |
| 14 |
* Store staff object |
| 15 |
* |
| 16 |
* @var Object |
| 17 |
*/ |
| 18 |
public $staff; |
| 19 |
|
| 20 |
/** |
| 21 |
* Re Invite Staff Constructor |
| 22 |
* |
| 23 |
* @return void |
| 24 |
*/ |
| 25 |
public function __construct( $staff_id ) { |
| 26 |
$this->staff = get_user_by( 'id', $staff_id ); |
| 27 |
parent::__construct(); |
| 28 |
} |
| 29 |
|
| 30 |
/** |
| 31 |
* Get email recipient |
| 32 |
* |
| 33 |
* @return string |
| 34 |
*/ |
| 35 |
public function get_recipient() { |
| 36 |
return $this->staff->user_email; |
| 37 |
} |
| 38 |
|
| 39 |
/** |
| 40 |
* Get new event email |
| 41 |
* |
| 42 |
* @return string |
| 43 |
*/ |
| 44 |
public function get_subject() { |
| 45 |
return esc_html__('Re Invitation Subject','timetics'); |
| 46 |
} |
| 47 |
|
| 48 |
/** |
| 49 |
* Get email title |
| 50 |
* |
| 51 |
* @return string |
| 52 |
*/ |
| 53 |
public function get_title() { |
| 54 |
return esc_html__('Re Invitation Staff','timetics'); |
| 55 |
} |
| 56 |
|
| 57 |
/** |
| 58 |
* Get template new event email |
| 59 |
* |
| 60 |
* @return string |
| 61 |
*/ |
| 62 |
public function get_template() { |
| 63 |
$user_login = $this->staff->user_login; |
| 64 |
$locale = get_user_locale($this->staff); |
| 65 |
$reset_key = get_password_reset_key($this->staff); |
| 66 |
$reset_url = site_url( "wp-login.php?action=rp&key={$reset_key}&login={$user_login}&wp_lang={$locale}" ); |
| 67 |
|
| 68 |
$reset_url = apply_filters( 'timetics_staff_password_reset_url', $reset_url, $reset_key, $user_login, $locale ); |
| 69 |
include_once TIMETICS_PLUGIN_DIR . '/templates/emails/new-staff.php'; |
| 70 |
} |
| 71 |
} |
| 72 |
|