若要新增範本則需新增資料,例如:
# email_id, email_key, can_disable, can_edit, from_role_id, to_role_id
38, SUBMISSION_PAPER_ACCEPT_ORAL, 0, 1, 128, 4096
代碼: 選擇全部
SELECT * FROM ocs.email_templates_default;
CREATE TABLE `email_templates_default_data` (
`email_key` varchar(30) NOT NULL,
`locale` varchar(5) NOT NULL DEFAULT 'en_US',
`subject` varchar(120) NOT NULL,
`body` text,
`description` text,
UNIQUE KEY `email_templates_default_data_pkey` (`email_key`,`locale`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
代碼: 選擇全部
SELECT * FROM ocs.email_templates_default_data;
assoc_type,看不出用途,全為256; assoc_id 為研討會編號
CREATE TABLE `email_templates_data` (
`email_key` varchar(64) NOT NULL,
`locale` varchar(5) NOT NULL DEFAULT 'en_US',
`assoc_type` bigint(20) DEFAULT '0',
`assoc_id` bigint(20) DEFAULT '0',
`subject` varchar(120) NOT NULL,
`body` text,
UNIQUE KEY `email_templates_data_pkey` (`email_key`,`locale`,`assoc_type`,`assoc_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
代碼: 選擇全部
SELECT * FROM ocs.email_templates_data;
代碼: 選擇全部
SELECT * FROM ocs.email_templates_data where assoc_id = 3
例如: 研討會編號4
代碼: 選擇全部
INSERT INTO ocs.email_templates_default_data ( email_key, locale, subject, body)
SELECT email_key, locale, subject, body FROM ocs.email_templates_data where assoc_id = 4
on duplicate key update subject = email_templates_data.subject, body = email_templates_data.body