#Newsletter 4.0

CREATE TABLE newsletter_group (
  group_id int(10) NOT NULL auto_increment,
  name varchar(200) default NULL,
  showgroup varchar(10) default NULL,
  PRIMARY KEY  (group_id)
) TYPE=MyISAM;

INSERT INTO newsletter_group VALUES (1, 'General','Yes');
INSERT INTO newsletter_group VALUES (2, 'Private','');

CREATE TABLE newsletter_letter (
  letter_id int(10) NOT NULL auto_increment,
  group_id int(10) default NULL,
  dateletter date default NULL,
  datesend date default NULL,
  title text,
  bodytext longtext,
  bodyhtml longtext,
  showletter varchar(5) default NULL,
  PRIMARY KEY  (letter_id)
) TYPE=MyISAM;

INSERT INTO newsletter_letter VALUES (1, 1, '0000-00-00', NULL, 'Personalized Newsletter Sample', 'To: \n[[firstname]],[[lastname]]\n[[position]]\n[[company]]\n[[email]]\n\nNew Product Release!\n-------------------------------\nWe are proudly to inform you that we are releasing a new product this month..\n.....\n.....\n\nThis Month Special!\n---------------------------\nCheck out our special offer for this month. Hurry while stock last!\n.....\n\n', '<FONT face=Arial><FONT size=2><STRONG>To:</STRONG>&nbsp;<BR>[[firstname]],[[lastname]]<BR>[[position]]<BR>[[company]]<BR>[[email]]<BR><BR></FONT></FONT><FONT face=Arial><FONT size=2><U><FONT color=#0033ff><STRONG>New Product Release!<BR></STRONG></FONT><BR></U>We are&nbsp;proudly to inform you that we are releasing a new product this month..<BR>.....<BR>.....<BR><BR></FONT></FONT><FONT face=Arial color=#0033ff size=2><U><STRONG>This Month Special!<BR></STRONG></U></FONT><FONT face=Arial color=#000000 size=2>Check out our special offer for this month. Hurry while stock last!<BR>.....</FONT>','');

CREATE TABLE newsletter_subscribe (
  group_id int(10) NOT NULL default '0',
  subscriber_id int(10) NOT NULL default '0'
) TYPE=MyISAM;


CREATE TABLE newsletter_subscriber (
  subscriber_id int(10) NOT NULL auto_increment,
  firstname varchar(50) default NULL,
  lastname varchar(50) default NULL,
  company varchar(120) default NULL,
  position varchar(50) default NULL,
  email text,
  lettertype varchar(5) default NULL,
  status varchar(20) default NULL,
  PRIMARY KEY  (subscriber_id)
) TYPE=MyISAM;


CREATE TABLE newsletter_delivery (
  delivery_id int(10) NOT NULL auto_increment,
  delivery date default NULL,
  letter_id int(10) default NULL,
  subscriber_id int(10) default NULL,
  status varchar(10) default NULL,
  PRIMARY KEY  (delivery_id)
) TYPE=MyISAM;


INSERT INTO sys_component VALUES ('', 'Newsletter', 'newsletter', 'newsletter', 'Multiple groups, confirmation, activation, unsubscribe, HTML or text-based, past newsletter, personalization, HTML editor, test email, import subscribers, bulk sending tool. ', '4.0', 'wce.listletter.php', '', 'Show','');
INSERT INTO sys_variable VALUES ('newsletter_newlistno', '20');
INSERT INTO sys_variable VALUES ('newsletter_msgconfirmemail', 'Dear [[firstname]],\n\nThank you for subscribing. We acknowledge that you are interested in our below newsletter:\n\n[[grouplist]] \n\nPlease click on the link below to activate your Newsletter subscription.\n\n[[activationurl]] \n\nFrom,\nwww.yourdomain.com\n');
INSERT INTO sys_variable VALUES ('newsletter_sublistno', '20');
INSERT INTO sys_variable VALUES ('newsletter_pageno', '10');
INSERT INTO sys_variable VALUES ('newsletter_newstextbody', '[[newsletterbody]]\r\n\r\n\r\nClick [[tohtmlurl]] to receive HTML-based newsletter in the future. \r\n\r\nYour are currently subscribed as: [[email]]. To unsubscribe, please click [[unsubscribeurl]].');
INSERT INTO sys_variable VALUES ('newsletter_newshtmlbody', '[[newsletterbody]]\r\n\r\n\r\n<font size=1 face=arial>Click [[totexturl]] to receive text-based newsletter in the future. Your are currently subscribed as: [[email]]. To unsubscribe, please click [[unsubscribeurl]] .</font>');
INSERT INTO sys_variable VALUES ('newsletter_seq', 'desc');
INSERT INTO sys_variable VALUES ('newsletter_enablebrowse', 'Yes');
INSERT INTO sys_variable VALUES ('newsletter_popemail', '');
INSERT INTO sys_variable VALUES ('newsletter_popserver', '');
INSERT INTO sys_variable VALUES ('newsletter_poplogin', '');
INSERT INTO sys_variable VALUES ('newsletter_poppass', '');
INSERT INTO sys_variable VALUES ('newsletter_page', 'samplenewsletter.php');
