Open Journal Systems  3.0.0
 All Classes Namespaces Functions Variables Groups Pages
PKPEmailTemplateDAO.inc.php
1 <?php
2 
18 class PKPEmailTemplateDAO extends DAO {
22  function PKPEmailTemplateDAO() {
23  parent::DAO();
24  }
25 
33  function getBaseEmailTemplate($emailKey, $assocType, $assocId) {
34  $result = $this->retrieve(
35  'SELECT d.email_key,
36  d.can_edit,
37  d.can_disable,
38  COALESCE(e.enabled, 1) AS enabled,
39  e.email_id,
40  e.assoc_type,
41  e.assoc_id,
42  d.from_role_id,
43  d.to_role_id
44  FROM email_templates_default d
45  LEFT JOIN email_templates e ON (d.email_key = e.email_key AND e.assoc_type = ? AND e.assoc_id = ?)
46  WHERE d.email_key = ?',
47  array($assocType, $assocId, $emailKey)
48  );
49 
50  $returner = null;
51  if ($result->RecordCount() != 0) {
52  $returner = $this->_returnBaseEmailTemplateFromRow($result->GetRowAssoc(false));
53  }
54 
55  $result->Close();
56  return $returner;
57  }
58 
66  function getLocaleEmailTemplate($emailKey, $assocType, $assocId) {
67  $result = $this->retrieve(
68  'SELECT d.email_key,
69  d.can_edit,
70  d.can_disable,
71  COALESCE(e.enabled, 1) AS enabled,
72  e.email_id,
73  e.assoc_type,
74  e.assoc_id,
75  d.from_role_id,
76  d.to_role_id
77  FROM email_templates_default d
78  LEFT JOIN email_templates e ON (d.email_key = e.email_key AND e.assoc_type = ? AND e.assoc_id = ?)
79  WHERE d.email_key = ?',
80  array($assocType, $assocId, $emailKey)
81  );
82 
83  $returner = null;
84  if ($result->RecordCount() != 0) {
85  $returner = $this->_returnLocaleEmailTemplateFromRow($result->GetRowAssoc(false));
86  } else {
87  $result->Close();
88 
89  // Check to see if there's a custom email template. This is done in PHP to avoid
90  // having to do a full outer join or union in SQL.
91  $result = $this->retrieve(
92  'SELECT e.email_key,
93  1 AS can_edit,
94  1 AS can_disable,
95  e.enabled,
96  e.email_id,
97  e.assoc_type,
98  e.assoc_id,
99  NULL AS from_role_id,
100  NULL AS to_role_id
101  FROM email_templates e
102  LEFT JOIN email_templates_default d ON (e.email_key = d.email_key)
103  WHERE d.email_key IS NULL AND
104  e.assoc_type = ? AND
105  e.assoc_id = ? AND
106  e.email_key = ?',
107  array($assocType, $assocId, $emailKey)
108  );
109  if ($result->RecordCount() != 0) {
110  $returner = $this->_returnLocaleEmailTemplateFromRow($result->GetRowAssoc(false));
111  }
112  }
113 
114  $result->Close();
115  return $returner;
116  }
117 
126  function getEmailTemplate($emailKey, $locale, $assocType, $assocId) {
127  $primaryLocale = AppLocale::getPrimaryLocale();
128 
129  $result = $this->retrieve(
130  'SELECT COALESCE(edl.subject, ddl.subject, edpl.subject, ddpl.subject) AS subject,
131  COALESCE(edl.body, ddl.body, edpl.body, ddpl.body) AS body,
132  COALESCE(e.enabled, 1) AS enabled,
133  d.email_key, d.can_edit, d.can_disable,
134  e.assoc_type, e.assoc_id, e.email_id,
135  COALESCE(ddl.locale, ddpl.locale) AS locale,
136  d.from_role_id, d.to_role_id
137  FROM email_templates_default d
138  LEFT JOIN email_templates_default_data ddpl ON (ddpl.email_key = d.email_key AND ddpl.locale = ?)
139  LEFT JOIN email_templates_default_data ddl ON (ddl.email_key = d.email_key AND ddl.locale = ?)
140  LEFT JOIN email_templates e ON (d.email_key = e.email_key AND e.assoc_type = ? AND e.assoc_id = ?)
141  LEFT JOIN email_templates_data edpl ON (edpl.email_key = e.email_key AND edpl.assoc_type = e.assoc_type AND edpl.assoc_id = e.assoc_id AND edpl.locale = ?)
142  LEFT JOIN email_templates_data edl ON (edl.email_key = e.email_key AND edl.assoc_type = e.assoc_type AND edl.assoc_id = e.assoc_id AND edl.locale = ?)
143  WHERE d.email_key = ?',
144  array($primaryLocale, $locale, $assocType, $assocId, $primaryLocale, $locale, $emailKey)
145  );
146 
147  $returner = null;
148  if ($result->RecordCount() != 0) {
149  $returner = $this->_returnEmailTemplateFromRow($result->GetRowAssoc(false));
150  $returner->setCustomTemplate(false);
151  } else {
152  $result->Close();
153 
154  // Check to see if there's a custom email template. This is done in PHP to avoid
155  // having to do a full outer join or union in SQL.
156  $result = $this->retrieve(
157  'SELECT ed.subject,
158  ed.body,
159  1 AS enabled,
160  e.email_key,
161  1 AS can_edit,
162  0 AS can_disable,
163  e.assoc_type,
164  e.assoc_id,
165  e.email_id,
166  ed.locale,
167  NULL AS from_role_id,
168  NULL AS to_role_id
169  FROM email_templates e
170  LEFT JOIN email_templates_data ed ON (ed.email_key = e.email_key AND ed.assoc_type = e.assoc_type AND ed.assoc_id = e.assoc_id)
171  LEFT JOIN email_templates_default d ON (e.email_key = d.email_key)
172  WHERE d.email_key IS NULL AND
173  e.assoc_type = ? AND
174  e.assoc_id = ? AND
175  e.email_key = ? AND
176  ed.locale = ?',
177  array($assocType, $assocId, $emailKey, $locale)
178  );
179  if ($result->RecordCount() != 0) {
180  $returner = $this->_returnEmailTemplateFromRow($result->GetRowAssoc(false));
181  $returner->setCustomTemplate(true);
182  }
183  }
184 
185  $result->Close();
186  return $returner;
187  }
188 
195  $emailTemplate = new BaseEmailTemplate();
196  $emailTemplate->setEmailId($row['email_id']);
197  $emailTemplate->setAssocType($row['assoc_type']);
198  $emailTemplate->setAssocId($row['assoc_id']);
199  $emailTemplate->setEmailKey($row['email_key']);
200  $emailTemplate->setEnabled($row['enabled'] == null ? 1 : $row['enabled']);
201  $emailTemplate->setCanDisable($row['can_disable']);
202  $emailTemplate->setFromRoleId($row['from_role_id']);
203  $emailTemplate->setToRoleId($row['to_role_id']);
204 
205  HookRegistry::call('EmailTemplateDAO::_returnBaseEmailTemplateFromRow', array(&$emailTemplate, &$row));
206 
207  return $emailTemplate;
208  }
209 
216  $emailTemplate = new LocaleEmailTemplate();
217  $emailTemplate->setEmailId($row['email_id']);
218  $emailTemplate->setAssocType($row['assoc_type']);
219  $emailTemplate->setAssocId($row['assoc_id']);
220  $emailTemplate->setEmailKey($row['email_key']);
221  $emailTemplate->setEnabled($row['enabled'] == null ? 1 : $row['enabled']);
222  $emailTemplate->setCanDisable($row['can_disable']);
223  $emailTemplate->setFromRoleId($row['from_role_id']);
224  $emailTemplate->setToRoleId($row['to_role_id']);
225 
226  $emailTemplate->setCustomTemplate(false);
227 
228  if (!HookRegistry::call('EmailTemplateDAO::_returnLocaleEmailTemplateFromRow', array(&$emailTemplate, &$row))) {
229  $result = $this->retrieve(
230  'SELECT dd.locale,
231  dd.description,
232  COALESCE(ed.subject, dd.subject) AS subject,
233  COALESCE(ed.body, dd.body) AS body
234  FROM email_templates_default_data dd
235  LEFT JOIN email_templates_data ed ON (dd.email_key = ed.email_key AND dd.locale = ed.locale AND ed.assoc_type = ? AND ed.assoc_id = ?)
236  WHERE dd.email_key = ?',
237  array($row['assoc_type'], $row['assoc_id'], $row['email_key'])
238  );
239 
240  while (!$result->EOF) {
241  $dataRow = $result->GetRowAssoc(false);
242  $emailTemplate->addLocale($dataRow['locale']);
243  $emailTemplate->setSubject($dataRow['locale'], $dataRow['subject']);
244  $emailTemplate->setBody($dataRow['locale'], $dataRow['body']);
245  $emailTemplate->setDescription($dataRow['locale'], $dataRow['description']);
246  $result->MoveNext();
247  }
248  $result->Close();
249 
250  // Retrieve custom email contents as well; this is done in PHP to avoid
251  // using a SQL outer join or union.
252  $result = $this->retrieve(
253  'SELECT ed.locale,
254  ed.subject,
255  ed.body
256  FROM email_templates_data ed
257  LEFT JOIN email_templates_default_data dd ON (ed.email_key = dd.email_key AND dd.locale = ed.locale)
258  WHERE ed.assoc_type = ? AND
259  ed.assoc_id = ? AND
260  ed.email_key = ? AND
261  dd.email_key IS NULL',
262  array($row['assoc_type'], $row['assoc_id'], $row['email_key'])
263  );
264 
265  while (!$result->EOF) {
266  $dataRow = $result->GetRowAssoc(false);
267  $emailTemplate->addLocale($dataRow['locale']);
268  $emailTemplate->setSubject($dataRow['locale'], $dataRow['subject']);
269  $emailTemplate->setBody($dataRow['locale'], $dataRow['body']);
270  $result->MoveNext();
271 
272  $emailTemplate->setCustomTemplate(true);
273  }
274 
275  $result->Close();
276  }
277 
278  return $emailTemplate;
279  }
280 
286  function &_returnEmailTemplateFromRow($row, $isCustomTemplate=null) {
287  $emailTemplate = new EmailTemplate();
288  $emailTemplate->setEmailId($row['email_id']);
289  $emailTemplate->setAssocType($row['assoc_type']);
290  $emailTemplate->setAssocId($row['assoc_id']);
291  $emailTemplate->setEmailKey($row['email_key']);
292  $emailTemplate->setLocale($row['locale']);
293  $emailTemplate->setSubject($row['subject']);
294  $emailTemplate->setBody($row['body']);
295  $emailTemplate->setEnabled($row['enabled'] == null ? 1 : $row['enabled']);
296  $emailTemplate->setCanDisable($row['can_disable']);
297  $emailTemplate->setFromRoleId($row['from_role_id']);
298  $emailTemplate->setToRoleId($row['to_role_id']);
299 
300  if ($isCustomTemplate !== null) {
301  $emailTemplate->setCustomTemplate($isCustomTemplate);
302  }
303 
304  HookRegistry::call('EmailTemplateDAO::_returnEmailTemplateFromRow', array(&$emailTemplate, &$row));
305 
306  return $emailTemplate;
307  }
308 
313  function insertBaseEmailTemplate(&$emailTemplate) {
314  return $this->update(
315  'INSERT INTO email_templates
316  (assoc_type, assoc_id, email_key, enabled)
317  VALUES
318  (?, ?, ?, ?)',
319  array(
320  $emailTemplate->getAssocType(),
321  $emailTemplate->getAssocId(),
322  $emailTemplate->getEmailKey(),
323  $emailTemplate->getEnabled() == null ? 0 : 1
324  )
325  );
326  $emailTemplate->setEmailId($this->getInsertId());
327  return $emailTemplate->getEmailId();
328  }
329 
334  function updateBaseEmailTemplate(&$emailTemplate) {
335  return $this->update(
336  'UPDATE email_templates
337  SET enabled = ?
338  WHERE email_id = ?',
339  array(
340  $emailTemplate->getEnabled() == null ? 0 : 1,
341  $emailTemplate->getEmailId()
342  )
343  );
344  }
345 
350  function insertLocaleEmailTemplate(&$emailTemplate) {
351  $this->insertBaseEmailTemplate($emailTemplate);
352  return $this->updateLocaleEmailTemplateData($emailTemplate);
353  }
354 
359  function updateLocaleEmailTemplate(&$emailTemplate) {
360  $this->updateBaseEmailTemplate($emailTemplate);
361  return $this->updateLocaleEmailTemplateData($emailTemplate);
362  }
363 
368  function updateLocaleEmailTemplateData(&$emailTemplate) {
369  foreach ($emailTemplate->getLocales() as $locale) {
370  $result = $this->retrieve(
371  'SELECT COUNT(*)
372  FROM email_templates_data
373  WHERE email_key = ? AND
374  locale = ? AND
375  assoc_type = ? AND
376  assoc_id = ?',
377  array(
378  $emailTemplate->getEmailKey(),
379  $locale,
380  $emailTemplate->getAssocType(),
381  $emailTemplate->getAssocId()
382  )
383  );
384 
385  if ($result->fields[0] == 0) {
386  $this->update(
387  'INSERT INTO email_templates_data
388  (email_key, locale, assoc_type, assoc_id, subject, body)
389  VALUES
390  (?, ?, ?, ?, ?, ?)',
391  array(
392  $emailTemplate->getEmailKey(),
393  $locale,
394  $emailTemplate->getAssocType(),
395  $emailTemplate->getAssocId(),
396  $emailTemplate->getSubject($locale),
397  $emailTemplate->getBody($locale)
398  )
399  );
400 
401  } else {
402  $this->update(
403  'UPDATE email_templates_data
404  SET subject = ?,
405  body = ?
406  WHERE email_key = ? AND
407  locale = ? AND
408  assoc_type = ? AND
409  assoc_id = ?',
410  array(
411  $emailTemplate->getSubject($locale),
412  $emailTemplate->getBody($locale),
413  $emailTemplate->getEmailKey(),
414  $locale,
415  $emailTemplate->getAssocType(),
416  $emailTemplate->getAssocId()
417  )
418  );
419  }
420  $result->Close();
421  }
422  }
423 
430  function deleteEmailTemplateByKey($emailKey, $assocType, $assocId) {
431  $this->update(
432  'DELETE FROM email_templates_data WHERE email_key = ? AND assoc_type = ? AND assoc_id = ?',
433  array($emailKey, $assocType, $assocId)
434  );
435  return $this->update(
436  'DELETE FROM email_templates WHERE email_key = ? AND assoc_type = ? AND assoc_id = ?',
437  array($emailKey, $assocType, $assocId)
438  );
439  }
440 
449  function getEmailTemplates($locale, $assocType, $assocId, $rangeInfo = null) {
450  $emailTemplates = array();
451 
452  $result = $this->retrieveRange(
453  'SELECT COALESCE(ed.subject, dd.subject) AS subject,
454  COALESCE(ed.body, dd.body) AS body,
455  COALESCE(e.enabled, 1) AS enabled,
456  d.email_key, d.can_edit, d.can_disable,
457  e.assoc_type, e.assoc_id, e.email_id,
458  dd.locale,
459  d.from_role_id, d.to_role_id
460  FROM email_templates_default d
461  LEFT JOIN email_templates_default_data dd ON (dd.email_key = d.email_key)
462  LEFT JOIN email_templates e ON (d.email_key = e.email_key AND e.assoc_type = ? AND e.assoc_id = ?)
463  LEFT JOIN email_templates_data ed ON (ed.email_key = e.email_key AND ed.assoc_type = e.assoc_type AND ed.assoc_id = e.assoc_id AND ed.locale = dd.locale)
464  WHERE dd.locale = ?',
465  array($assocType, $assocId, $locale),
466  $rangeInfo
467  );
468 
469  while (!$result->EOF) {
470  $emailTemplates[] = $this->_returnEmailTemplateFromRow($result->GetRowAssoc(false), false);
471  $result->MoveNext();
472  }
473  $result->Close();
474 
475  // Fetch custom email templates as well; this is done in PHP
476  // to avoid a union or full outer join call in SQL.
477  $result = $this->retrieve(
478  'SELECT ed.subject,
479  ed.body,
480  e.enabled,
481  e.email_key,
482  1 AS can_edit,
483  1 AS can_disable,
484  e.assoc_type,
485  e.assoc_id,
486  e.email_id,
487  ed.locale,
488  NULL AS from_role_id,
489  NULL AS to_role_id
490  FROM email_templates e
491  LEFT JOIN email_templates_data ed ON (e.email_key = ed.email_key AND ed.assoc_type = e.assoc_type AND ed.assoc_id = e.assoc_id AND ed.locale = ?)
492  LEFT JOIN email_templates_default d ON (e.email_key = d.email_key)
493  WHERE e.assoc_type = ? AND
494  e.assoc_id = ? AND
495  d.email_key IS NULL',
496  array($locale, $assocType, $assocId)
497  );
498 
499  while (!$result->EOF) {
500  $emailTemplates[] = $this->_returnEmailTemplateFromRow($result->GetRowAssoc(false), true);
501  $result->MoveNext();
502  }
503  $result->Close();
504 
505  // Sort all templates by email key.
506  $compare = create_function('$t1, $t2', 'return strcmp($t1->getEmailKey(), $t2->getEmailKey());');
507  usort ($emailTemplates, $compare);
508 
509  return $emailTemplates;
510  }
511 
516  function getInsertId() {
517  return $this->_getInsertId('email_templates', 'emailId');
518  }
519 
525  function deleteEmailTemplatesByAssoc($assocType, $assocId) {
526  $this->update(
527  'DELETE FROM email_templates_data WHERE assoc_type = ? AND assoc_id = ?', array($assocType, $assocId)
528  );
529  return $this->update(
530  'DELETE FROM email_templates WHERE assoc_type = ? AND assoc_id = ?', array($assocType, $assocId)
531  );
532  }
533 
538  function deleteEmailTemplatesByLocale($locale) {
539  $this->update(
540  'DELETE FROM email_templates_data WHERE locale = ?', $locale
541  );
542  }
543 
549  $this->update(
550  'DELETE FROM email_templates_default_data WHERE locale = ?', $locale
551  );
552  }
553 
562  function templateExistsByKey($emailKey, $assocType = null, $assocId = null) {
563  if ($assocType !== null) {
564  $result = $this->retrieve(
565  'SELECT COUNT(*)
566  FROM email_templates
567  WHERE email_key = ? AND
568  assoc_type = ? AND
569  assoc_id = ?',
570  array(
571  $emailKey,
572  $assocType,
573  $assocId
574  )
575  );
576  if (isset($result->fields[0]) && $result->fields[0] != 0) {
577  $result->Close();
578  return true;
579  }
580 
581  $result->Close();
582  }
583 
584  $result = $this->retrieve(
585  'SELECT COUNT(*)
586  FROM email_templates_default
587  WHERE email_key = ?',
588  $emailKey
589  );
590  if (isset($result->fields[0]) && $result->fields[0] != 0) {
591  $returner = true;
592  } else {
593  $returner = false;
594  }
595 
596  $result->Close();
597  return $returner;
598  }
599 
608  function customTemplateExistsByKey($emailKey, $assocType, $assocId) {
609  $result = $this->retrieve(
610  'SELECT COUNT(*)
611  FROM email_templates e
612  LEFT JOIN email_templates_default d ON (e.email_key = d.email_key)
613  WHERE e.email_key = ? AND
614  d.email_key IS NULL AND
615  e.assoc_type = ? AND
616  e.assoc_id = ?',
617  array(
618  $emailKey,
619  $assocType,
620  $assocId
621  )
622  );
623  $returner = (isset($result->fields[0]) && $result->fields[0] != 0);
624 
625  $result->Close();
626  return $returner;
627  }
628 
634  function getCustomTemplateKeys($assocType, $assocId) {
635  $result = $this->retrieve('SELECT email_key FROM email_templates WHERE assoc_type = ? AND assoc_id = ?', array($assocType, $assocId));
636  $keys = array();
637  while (!$result->EOF) {
638  $row = $result->GetRowAssoc(false);
639  $keys[] = $row['email_key'];
640  $result->MoveNext();
641  }
642 
643  return $keys;
644  }
645 
646  function getMainEmailTemplatesFilename() {
647  return 'registry/emailTemplates.xml';
648  }
649 
650  function getMainEmailTemplateDataFilename($locale = null) {
651  if ($locale !== null && !PKPLocale::isLocaleValid($locale)) return null;
652  if ($locale === null) $locale = '{$installedLocale}';
653  return "locale/$locale/emailTemplates.xml";
654  }
655 
671  function installEmailTemplates($templatesFile, $returnSql = false, $emailKey = null, $skipExisting = false) {
672  $xmlDao = new XMLDAO();
673  $sql = array();
674  $data = $xmlDao->parseStruct($templatesFile, array('email'));
675  if (!isset($data['email'])) return false;
676  foreach ($data['email'] as $entry) {
677  $attrs = $entry['attributes'];
678  if ($emailKey && $emailKey != $attrs['key']) continue;
679  if ($skipExisting && $this->templateExistsByKey($attrs['key'])) continue;
680  $dataSource = $this->getDataSource();
681  $sql[] = 'INSERT INTO email_templates_default
682  (email_key, can_disable, can_edit, from_role_id, to_role_id)
683  VALUES
684  (' .
685  $dataSource->qstr($attrs['key']) . ', ' .
686  ($attrs['can_disable']?1:0) . ', ' .
687  ($attrs['can_edit']?1:0) . ', ' .
688  (isset($attrs['from_role_id'])?((int) $attrs['from_role_id']):'null') . ', ' .
689  (isset($attrs['to_role_id'])?((int) $attrs['to_role_id']):'null') .
690  ")";
691  if (!$returnSql) {
692  $this->update(array_shift($sql));
693  }
694  }
695  if ($returnSql) return $sql;
696  return true;
697  }
698 
710  function installEmailTemplateData($templateDataFile, $returnSql = false, $emailKey = null) {
711  $xmlDao = new XMLDAO();
712  $sql = array();
713  $data = $xmlDao->parse($templateDataFile, array('email_texts', 'email_text', 'subject', 'body', 'description'));
714  if (!$data) return false;
715  $locale = $data->getAttribute('locale');
716 
717  foreach ($data->getChildren() as $emailNode) {
718  if ($emailKey && $emailKey != $emailNode->getAttribute('key')) continue;
719  $dataSource = $this->getDataSource();
720  $sql[] = 'DELETE FROM email_templates_default_data WHERE email_key = ' . $dataSource->qstr($emailNode->getAttribute('key')) . ' AND locale = ' . $dataSource->qstr($locale);
721  if (!$returnSql) {
722  $this->update(array_shift($sql));
723  }
724 
725  $sql[] = 'INSERT INTO email_templates_default_data
726  (email_key, locale, subject, body, description)
727  VALUES
728  (' .
729  $dataSource->qstr($emailNode->getAttribute('key')) . ', ' .
730  $dataSource->qstr($locale) . ', ' .
731  $dataSource->qstr($emailNode->getChildValue('subject')) . ', ' .
732  $dataSource->qstr($emailNode->getChildValue('body')) . ', ' .
733  $dataSource->qstr($emailNode->getChildValue('description')) .
734  ")";
735  if (!$returnSql) {
736  $this->update(array_shift($sql));
737  }
738  }
739  if ($returnSql) return $sql;
740  return true;
741  }
742 }
743 
744 ?>
templateExistsByKey($emailKey, $assocType=null, $assocId=null)
& _returnEmailTemplateFromRow($row, $isCustomTemplate=null)
updateLocaleEmailTemplate(&$emailTemplate)
Operations for retrieving and modifying objects from a database.
Definition: DAO.inc.php:30
Operations for retrieving and modifying Email Template objects.
updateBaseEmailTemplate(&$emailTemplate)
& retrieve($sql, $params=false, $callHooks=true)
Definition: DAO.inc.php:84
installEmailTemplates($templatesFile, $returnSql=false, $emailKey=null, $skipExisting=false)
static getPrimaryLocale()
getEmailTemplates($locale, $assocType, $assocId, $rangeInfo=null)
Operations for retrieving and modifying objects from an XML data source.
Definition: XMLDAO.inc.php:19
& retrieveRange($sql, $params=false, $dbResultRange=null, $callHooks=true)
Definition: DAO.inc.php:174
getEmailTemplate($emailKey, $locale, $assocType, $assocId)
customTemplateExistsByKey($emailKey, $assocType, $assocId)
_getInsertId($table= '', $id= '')
Definition: DAO.inc.php:249
getLocaleEmailTemplate($emailKey, $assocType, $assocId)
getBaseEmailTemplate($emailKey, $assocType, $assocId)
static call($hookName, $args=null)
& getDataSource()
Definition: DAO.inc.php:38
deleteEmailTemplateByKey($emailKey, $assocType, $assocId)
deleteEmailTemplatesByAssoc($assocType, $assocId)
static isLocaleValid($locale)
getCustomTemplateKeys($assocType, $assocId)
updateLocaleEmailTemplateData(&$emailTemplate)
update($sql, $params=false, $callHooks=true, $dieOnError=true)
Definition: DAO.inc.php:208
insertBaseEmailTemplate(&$emailTemplate)
Describes basic email template properties.
insertLocaleEmailTemplate(&$emailTemplate)
installEmailTemplateData($templateDataFile, $returnSql=false, $emailKey=null)