/** * @param string $email Email address to log * @param string|array $list_ids String or array of list ID's * @param array $data The data that was sent to MailChimp * @param string $type The type that was used (form, integration slug, ...) * @param int $related_object_id ID of the related object, if any (form, comment, user, etc..) * @param string $url The URl the request originated from * * @return false|int */ public function add($email, $list_ids, $data = array(), $type = 'form', $related_object_id = 0, $url = '') { // make sure `$list_ids` is a string if (is_array($list_ids)) { $list_ids = implode(',', array_map('trim', $list_ids)); } return $this->db->insert($this->table_name, array('email' => $email, 'list_ids' => $list_ids, 'data' => json_encode($data), 'type' => $type, 'related_object_ID' => (int) $related_object_id, 'url' => $url, 'datetime' => current_time('mysql', true))); }