Exemplo n.º 1
0
 /**
  * Make the notification object.
  *
  * @since 1.0
  *
  * @param Reminder         $reminder
  * @param Key              $key
  * @param Template_Manager $manager
  *
  * @return Notification
  */
 protected function make_notification(Reminder $reminder, Key $key, Template_Manager $manager)
 {
     $template = $reminder->get_post();
     $notification = new Notification($key->get_customer()->wp_user, $manager, $template->post_content, $template->post_title);
     $transaction = $key->get_transaction();
     if (!empty($transaction->cart_details->is_guest_checkout)) {
         if (function_exists('it_exchange_guest_checkout_generate_guest_user_object')) {
             $notification = new Guest_Notification($notification, $transaction);
         } else {
             return null;
         }
     }
     $notification->add_data_source($key);
     $notification->add_data_source(new Discount($key));
     return $notification;
 }