Merge pull request #3644 from eileenmcnaughton/e-notice-ps
[civicrm-core.git] / CRM / Upgrade / 4.5.beta2.msg_template / civicrm_msg_template.tpl
1 {php}
2 $dir = SMARTY_DIR . '/../../CRM/Upgrade/4.5.beta2.msg_template/message_templates';
3 $templates = array();
4 foreach (preg_grep('/\.tpl$/', scandir($dir)) as $filename) {
5 $templates[] = array('name' => basename($filename, '.tpl'), 'filename' => "$dir/$filename");
6 }
7 $this->assign('templates', $templates);
8 {/php}
9
10 {foreach from=$templates item=tpl}
11 {fetch assign=content file=$tpl.filename}
12 INSERT INTO civicrm_msg_template
13 (msg_title, msg_subject, msg_text, msg_html, workflow_id, is_default, is_reserved) VALUES
14 ('{$tpl.name} Template', '{$tpl.name}', '', '{$content|escape:"quotes"}' ,NULL, 1, 0);
15 {/foreach}