<?xml version="1.0" encoding="UTF-8"?>
<domain-models xmlns="http://axelor.com/xml/ns/domain-models"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://axelor.com/xml/ns/domain-models http://axelor.com/xml/ns/domain-models/domain-models_5.2.xsd">

  <module name="message" package="com.axelor.apps.message.db"/>

  <entity name="Template" lang="java">

  	<string name="name" title="Name" required="true" namecolumn="true"/>
  	<string name="content" large="true" multiline="true" title="Content"/>
  	<string name="subject" large="true" multiline="true" title="Subject"/>
  	<string name="fromAdress" large="true" multiline="true" title="From" />
  	<string name="replyToRecipients" large="true" multiline="true" title="Reply to" />
  	<string name="toRecipients" large="true" multiline="true" title="To"/>
  	<string name="ccRecipients" large="true" multiline="true" title="Cc"/>
  	<string name="bccRecipients" large="true" multiline="true" title="Bcc"/>
  	<string name="target" title="Target receptor"/>
  	<integer name="mediaTypeSelect" title="Media Type" required="true" selection="template.media.type.select" default="2"/>
  	<string name="addressBlock" large="true" multiline="true" title="Address Block"/>
	<many-to-one name="metaModel" ref="com.axelor.meta.db.MetaModel" title="Model"/>
	<boolean name="isDefault" title="Default"/>
	<boolean name="isSystem" title="System"/>
	<boolean name="isJson" title="Json"/>
  	<many-to-one name="metaJsonModel" ref="com.axelor.meta.db.MetaJsonModel" title="Model"/>
	
	<one-to-many name="templateContextList" ref="com.axelor.apps.message.db.TemplateContext" mappedBy="template" title="Context"/>
	

	<extra-code><![CDATA[
		// MEDIA TYPE SELECT
		public static final int MEDIA_TYPE_MAIL = 1;
		public static final int MEDIA_TYPE_EMAIL = 2; 
		public static final int MEDIA_TYPE_CHAT = 3; 
    ]]></extra-code>
    
  </entity>

</domain-models>
