<?php
class ModelAccountNewsletter extends Model {

	public function addNewsletter($data){

		$this->db->query("INSERT INTO " . DB_PREFIX . "newsletter SET email = '" . $this->db->escape($data['email_newsletter']) . "', name = '".$this->db->escape($data['name_newsletter'])."'");

	}

	public function getNewsletterByEmail($email){

		$query = $this->db->query("SELECT * FROM ". DB_PREFIX ."newsletter WHERE email = '" . $this->db->escape($email) . "'");

		if($query->rows){
			return true;
		}else{
			return false;
		}

	}

}
