public function trigger($entry_id, $meta, $data)
 {
     var_dump($data);
     exit;
     if ($this->EE->session->cache('postmaster', 'entry_trigger') == 'new') {
         //get tags
         $query = $this->EE->db->select('tag_entries.tag_id, tag_name')->from('tag_entries')->join('tag_tags', 'tag_entries.tag_id=tag_tags.tag_id', 'left')->where('entry_id', $entry_id)->get();
         if ($query->num_rows() == 0) {
             return;
         }
         $tags = array();
         foreach ($query->result_array() as $row) {
             $tags[$row['tag_id']] = $row['tag_name'];
         }
         $q = $this->EE->db->select('channel_url, comment_url')->from('channels')->where('channel_id', $meta['channel_id'])->get();
         $channel_data = $q->row_array();
         $basepath = $channel_data['comment_url'] != '' ? $channel_data['comment_url'] : $channel_data['channel_url'];
         //get subscribers
         foreach ($tags as $tag_id => $tag_name) {
             $query = $this->EE->db->select('tag_subscriptions.member_id, screen_name, email')->distinct()->from('tag_subscriptions')->join('members', 'tag_subscriptions.member_id=members.member_id', 'left')->where('tag_subscriptions.tag_id', $tag_id)->get();
             if ($query->num_rows() == 0) {
                 continue;
             }
             $data['entry_id'] = $entry_id;
             $data['tag_id'] = $tag_id;
             $data['tag'] = $tag_name;
             $data['entry_id_path'] = $this->EE->functions->create_page_url($basepath, $entry_id);
             $data['url_title_path'] = $data['path'] = $this->EE->functions->create_page_url($basepath, $data['url_title']);
             foreach ($query->result_array() as $row) {
                 $data = array_merge($data, $row);
                 parent::send($data);
             }
         }
     }
 }
 public function trigger($value, $label, $entry_id)
 {
     $entry = $this->channel_data->get_channel_entry($entry_id);
     $entry = $this->channel_data->utility->add_prefix('hook', $entry->row_array());
     $parse_vars = array('entry_id' => $entry_id, 'value' => $value, 'label' => $label);
     $member = $this->EE->channel_data->get_member($value)->row();
     return parent::send($parse_vars, $member, $entry);
 }
Exemplo n.º 3
0
 public function trigger($member_id, $member_data, $entry_data, $success, $is_admin)
 {
     if ($success) {
         $entry = $this->channel_data->get_channel_entry($entry_data['entry_id'])->row_array();
         $password = isset($member_data['password']) ? $member_data['password'] : NULL;
         $vars = array_merge($entry_data, array('entry_id' => $entry_data['entry_id'], 'member_id' => $member_id, 'is_admin' => $is_admin, 'password' => $password));
         parent::send($vars, FALSE, $entry);
     }
 }
 public function parse($array, $vars = array(), $member_data = FALSE, $entry_data = array())
 {
     $return = parent::parse($array, $vars, $member_data, $entry_data);
     foreach ($return as $index => $value) {
         if (empty($value) && isset($vars[$index]) && !empty($vars[$index])) {
             $return[$index] = $vars[$index];
         }
     }
     return $return;
 }
 public function trigger($tagdata, $row, $obj)
 {
     if (preg_match('/^(true|t|y|yes|1)$/', strtolower($this->EE->TMPL->fetch_param('email')))) {
         $entry = $this->channel_data->get_channel_entry($row['entry_id'])->row_array();
         $member = $this->channel_data->get_member($row['author_id'])->row_array();
         $parse_vars = array('tagdata' => $tagdata);
         return parent::send($parse_vars, $member, $entry);
     }
     return array('return_data' => $tagdata);
 }
 public function trigger($order)
 {
     $member = $this->channel_data->get_member($order['member_id'])->row_array();
     foreach ($order['items'] as $index => $item) {
         if (isset($item['modifiers'])) {
             $order['items'][$index]['modifiers'] = $this->channel_data->utility->add_prefix('modifier', $item['modifiers']);
         }
     }
     $order['items'] = $this->channel_data->utility->add_prefix('item', $order['items']);
     return parent::send($order, $member);
 }
 public function trigger($subscription_id, $sub_data, $item, $sub_permissions)
 {
     $vars = array('subscription_id' => $subscription_id);
     if ($sub_permissions) {
         $vars['sub_permissions'] = $sub_permissions;
     }
     $vars = array_merge($vars, $sub_data, $item);
     $vars['meta'] = array($vars['meta']);
     $vars['meta'][0]['subscription_options'] = array($vars['meta'][0]['subscription_options']);
     $member = $this->EE->postmaster_model->get_member($vars['member_id'], 'member');
     return parent::send($vars, $member);
 }
 public function trigger()
 {
     $this->order = $parse_vars = $this->cart->order();
     foreach ($parse_vars['items'] as $index => $item) {
         $meta = array(array('subscription_options' => array(isset($item['meta']['subscription_options']) ? $item['meta']['subscription_options'] : array()), 'subscription' => isset($item['meta']['subscription']) ? $item['meta']['subscription'] : FALSE));
         $parse_vars['items'][$index]['item_options'] = array($parse_vars['items'][$index]['item_options']);
         $parse_vars['items'][$index]['meta'] = $meta;
     }
     $parse_vars['purchased_items'] = implode('|', $parse_vars['purchased_items']);
     $parse_vars['auth'] = array($parse_vars['auth']);
     $obj = parent::send($parse_vars);
     if ($obj->response->status) {
         if ($this->EE->extensions->active_hook('postmaster_cartthrob_processing') === TRUE) {
             $this->EE->extensions->call('postmaster_cartthrob_processing', $this->order);
         }
     }
     return $obj;
 }
Exemplo n.º 9
0
 public function __construct()
 {
     parent::__construct();
 }
Exemplo n.º 10
0
 public function trigger($value, $label)
 {
     $parse_vars = array();
     $member = $this->EE->channel_data->get_member($value)->row();
     return parent::send($parse_vars, $member);
 }
Exemplo n.º 11
0
 public function __construct($params = array())
 {
     parent::__construct(array());
 }
 public function trigger($member_data, $member_id)
 {
     $member = $this->channel_data->get_member($member_id);
     parent::send($member_data, $member->row_array());
 }
 public function trigger($member_data, $member_id)
 {
     $entry = $this->channel_data->get_entry($member_data['entry_id']);
     $member = $this->channel_data->get_member($member_id);
     parent::send($member_data, $member->row_array(), $entry->row_array());
 }
Exemplo n.º 14
0
 public function trigger($tagdata, $entry)
 {
     $parse_vars = array('tagdata' => $tagdata);
     return parent::send($parse_vars, FALSE, $entry, $tagdata);
 }
 public function trigger($email, $entry, $custom_data = array())
 {
     $parse_vars = array_merge(array('email' => $email), $custom_data);
     return parent::send($parse_vars, FALSE, $entry);
 }
 public function trigger($subscription = array())
 {
     $member = $this->EE->postmaster_model->get_member($subscription['member_id'], 'member');
     return parent::send($subscription, $member);
 }
 public function trigger($data, $type, $entry_id, $field_id)
 {
     $parse_vars = array('not_found' => $data, 'entry_id' => $entry_id, 'field_id' => $field_id, $type => $data);
     return parent::send($parse_vars);
 }