CREATE TABLE IF NOT EXISTS `#__ccnewsletter_newsletters` (
  `id` int(11) NOT NULL auto_increment,
  `name` text NOT NULL,
  `body` text NOT NULL,
  PRIMARY KEY  (`id`)
)  ;

CREATE TABLE IF NOT EXISTS `#__ccnewsletter_subscribers` (
  `id` int(11) NOT NULL auto_increment,
  `name` text NOT NULL,
  `email` text NOT NULL,
  `plainText` tinyint(1) NOT NULL default '0',
  `enabled` tinyint(1) NOT NULL default '1',
  `sdate` datetime NOT NULL default '0000-00-00 00:00:00',
  `lastSentNewsletter` int(11) default NULL,
  PRIMARY KEY  (`id`),
  KEY (`lastSentNewsletter`)
)  ;

CREATE TABLE IF NOT EXISTS `#__ccnewsletter_acknowledgement` (
  `id` int(2) NOT NULL default '0',
  `subs_title` varchar(255) NOT NULL default '',
  `subs_content` mediumtext NOT NULL,
  `unsubs_title` varchar(255) NOT NULL default '',
  `unsubs_content` mediumtext NOT NULL,
  `deactivation_title` varchar(255) NOT NULL default '',
  `deactivation_content` mediumtext NOT NULL,
  PRIMARY KEY  (`id`)
) ;

CREATE TABLE IF NOT EXISTS `#__ccnewsletter_configuration` (
`id` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`fromname` VARCHAR( 255 ) NOT NULL ,
`fromemail` VARCHAR( 255 ) NOT NULL ,
`testemail` VARCHAR( 255 ) NOT NULL ,
`emailbatch` VARCHAR( 20 ) NOT NULL ,
`batchinter` VARCHAR( 20 ) NOT NULL ,
`scripttimeout` VARCHAR( 20 ) NOT NULL ,
`extendemail` TINYINT( 1 ) NOT NULL ,
`syncalluser` TINYINT( 1 ) NOT NULL ,
`captcha` TINYINT( 1 ) NOT NULL ,
`unsubscribebt` TINYINT( 1 ) NOT NULL,
`date_format` VARCHAR( 50 ) NOT NULL,
`acknowledgeoff` tinyint(1) NOT NULL default '0',
`acknowledgeon` tinyint(1) NOT NULL default '0',
`emailactivation` tinyint(1) NOT NULL default '0',
`deactivation` tinyint(1) NOT NULL default '0'
);
