<?xml version="1.0" encoding="iso-8859-1" ?>

<table>
  <base>CRM/Core</base>
  <class>MessageTemplate</class>
  <name>civicrm_msg_template</name>
  <comment>Users will need a way to save and retrieve templates with tokens for use in recurring email communication tasks</comment>
  <add>1.6</add>
  <title>Message Template</title>
  <titlePlural>Message Templates</titlePlural>
  <icon>fa-newspaper-o</icon>
  <labelField>msg_title</labelField>
  <paths>
    <add>civicrm/admin/messageTemplates/add?action=add&amp;reset=1</add>
    <view>civicrm/admin/messageTemplates/add?action=view&amp;id=[id]&amp;reset=1</view>
    <update>civicrm/admin/messageTemplates/add?action=update&amp;id=[id]&amp;reset=1</update>
    <delete>civicrm/admin/messageTemplates?action=delete&amp;id=[id]&amp;reset=1</delete>
  </paths>
  <field>
    <name>id</name>
    <title>Message Template ID</title>
    <type>int unsigned</type>
    <required>true</required>
    <comment>Message Template ID</comment>
    <html>
      <type>Number</type>
    </html>
    <add>1.6</add>
  </field>
  <primaryKey>
    <name>id</name>
    <autoincrement>true</autoincrement>
  </primaryKey>
  <field>
    <name>msg_title</name>
    <title>Message Template Title</title>
    <type>varchar</type>
    <length>255</length>
    <comment>Descriptive title of message</comment>
    <html>
      <type>Text</type>
    </html>
    <add>1.6</add>
  </field>
  <field>
    <name>msg_subject</name>
    <title>Message Template Subject</title>
    <type>text</type>
    <comment>Subject for email message.</comment>
    <html>
      <type>Text</type>
    </html>
    <add>1.6</add>
    <!-- type changed from VARCHAR(255) to TEXT in 3.1 -->
  </field>
  <field>
    <name>msg_text</name>
    <title>Message Template Text</title>
    <type>longtext</type>
    <html>
      <type>TextArea</type>
      <rows>10</rows>
      <cols>75</cols>
    </html>
    <comment>Text formatted message</comment>
    <add>1.6</add>
    <!-- type changed from TEXT to LONGTEXT in 4.3 -->
  </field>
  <field>
    <name>msg_html</name>
    <title>Message Template HTML</title>
    <type>longtext</type>
    <html>
      <type>RichTextEditor</type>
      <rows>10</rows>
      <cols>75</cols>
    </html>
    <comment>HTML formatted message</comment>
    <add>1.6</add>
    <!-- type changed from TEXT to LONGTEXT in 4.3 -->
  </field>
  <field>
    <name>is_active</name>
    <title>Is Active</title>
    <type>boolean</type>
    <default>1</default>
    <required>true</required>
    <html>
      <type>CheckBox</type>
      <label>Enabled</label>
    </html>
    <add>1.6</add>
  </field>
  <field>
    <name>workflow_id</name>
    <title>Deprecated field for Message Template Workflow.</title>
    <type>int unsigned</type>
    <comment>a pseudo-FK to civicrm_option_value</comment>
    <add>3.1</add>
  </field>
  <field>
    <name>workflow_name</name>
    <title>Message Template Workflow Name</title>
    <type>varchar</type>
    <length>255</length>
    <add>5.26</add>
  </field>
  <field>
    <name>is_default</name>
    <title>Message Template Is Default?</title>
    <type>boolean</type>
    <default>1</default>
    <required>true</required>
    <html>
      <type>CheckBox</type>
      <label>Default</label>
    </html>
    <comment>is this the default message template for the workflow referenced by workflow_id?</comment>
    <add>3.1</add>
  </field>
  <field>
    <name>is_reserved</name>
    <title>Message Template Is Reserved?</title>
    <type>boolean</type>
    <default>0</default>
    <required>true</required>
    <comment>is this the reserved message template which we ship for the workflow referenced by workflow_id?</comment>
    <add>3.1</add>
  </field>
  <field>
    <name>is_sms</name>
    <title>Message Template is used for SMS?</title>
    <type>boolean</type>
    <default>0</default>
    <required>true</required>
    <comment>Is this message template used for sms?</comment>
    <add>4.5</add>
  </field>
  <field>
    <name>pdf_format_id</name>
    <title>Message Template Format</title>
    <type>int unsigned</type>
    <comment>a pseudo-FK to civicrm_option_value containing PDF Page Format.</comment>
    <pseudoconstant>
      <optionGroupName>pdf_format</optionGroupName>
      <keyColumn>id</keyColumn>
    </pseudoconstant>
    <html>
      <type>Select</type>
    </html>
    <add>3.4</add>
  </field>
</table>
