2 Required vars: abtest, fields
4 Note: Much of this file is duplicated in crmMailing and crmMailingAB with variations on placement/title/binding.
5 It could perhaps be thinned by 30-60% by making more directives.
7 This template follows a basic pattern. For each included field, there are three variants, as in this example:
8 - fromAddress: The default From: address shared by both mailings (representatively mapped to mailing A)
9 - fromAddressA: The From: address for mailing A
10 - fromAddressB: The From: address for mailing B
11 Each variant is guarded with "ng-if='fields.fieldName'"; if true, the field will be displayed and
12 processed by Angular; if false, the field will be hidden and completely ignored by Angular.
14 <div class=
"crm-block" ng-form=
"subform" crm-ui-id-scope
>
15 <div class=
"crm-group">
18 <div crm-ui-field=
"subform.msg_template_id" crm-title=
"ts('Template')" style=
"background: #bbf; width:100%; padding: 0.1em;" ng-if=
"fields.msg_template_id">
19 <div ng-controller=
"MsgTemplateCtrl">
21 crm-ui-id=
"subform.msg_template_id"
22 name=
"msg_template_id"
23 crm-ui-select=
"{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Message Template')}"
24 ng-model=
"abtest.mailings.a.msg_template_id"
25 ng-change=
"loadTemplate(abtest.mailings.a, abtest.mailings.a.msg_template_id)"
27 <option value=
""></option>
28 <option ng-repeat=
"frm in crmMsgTemplates.getAll() | orderBy:'msg_title'" ng-value=
"frm.id">{{frm.msg_title}}
</option>
30 <a ng-click=
"saveTemplate(abtest.mailings.a)" class=
"crm-hover-button action-item" title=
"{{ts('Save As')}}"><span class=
"icon ui-icon-disk"></span></a>
33 <div crm-ui-field=
"subform.msg_template_idA" crm-title=
"ts('Template (A)')" style=
"background: #bbf; width:100%; padding: 0.1em;" ng-if=
"fields.msg_template_idA">
34 <div ng-controller=
"MsgTemplateCtrl">
36 crm-ui-id=
"subform.msg_template_idA"
37 name=
"msg_template_idA"
38 crm-ui-select=
"{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Message Template')}"
39 ng-model=
"abtest.mailings.a.msg_template_id"
40 ng-change=
"loadTemplate(abtest.mailings.a, abtest.mailings.a.msg_template_id)"
42 <option value=
""></option>
43 <option ng-repeat=
"frm in crmMsgTemplates.getAll() | orderBy:'msg_title'" ng-value=
"frm.id">{{frm.msg_title}}
</option>
45 <a ng-click=
"saveTemplate(abtest.mailings.a)" class=
"crm-hover-button action-item" title=
"{{ts('Save As')}}"><span class=
"icon ui-icon-disk"></span></a>
48 <div crm-ui-field=
"subform.msg_template_idB" crm-title=
"ts('Template (B)')" style=
"background: #bbf; width:100%; padding: 0.1em;" ng-if=
"fields.msg_template_idB">
49 <div ng-controller=
"MsgTemplateCtrl">
51 crm-ui-id=
"subform.msg_template_idB"
52 name=
"msg_template_idB"
53 crm-ui-select=
"{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Message Template')}"
54 ng-model=
"abtest.mailings.b.msg_template_id"
55 ng-change=
"loadTemplate(abtest.mailings.b, abtest.mailings.b.msg_template_id)"
57 <option value=
""></option>
58 <option ng-repeat=
"frm in crmMsgTemplates.getAll() | orderBy:'msg_title'" ng-value=
"frm.id">{{frm.msg_title}}
</option>
60 <a ng-click=
"saveTemplate(abtest.mailings.b)" class=
"crm-hover-button action-item" title=
"{{ts('Save As')}}"><span class=
"icon ui-icon-disk"></span></a>
65 <div crm-ui-field=
"subform.fromAddress" crm-title=
"ts('From')" ng-if=
"fields.fromAddress">
66 <span ng-controller=
"EmailAddrCtrl" crm-mailing-from-address=
"fromPlaceholder" crm-mailing=
"abtest.mailings.a">
68 crm-ui-id=
"subform.fromAddress"
71 ui-options=
"{dropdownAutoWidth : true, allowClear: false, placeholder: ts('Email address')}"
72 ng-model=
"fromPlaceholder.label"
73 ng-options=
"frm.label as frm.label for frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'"
75 <option value=
""></option>
79 <div crm-ui-field=
"subform.fromAddressA" crm-title=
"ts('From (A)')" ng-if=
"fields.fromAddressA">
80 <span ng-controller=
"EmailAddrCtrl" crm-mailing-from-address=
"fromPlaceholder" crm-mailing=
"abtest.mailings.a">
82 crm-ui-id=
"subform.fromAddressA"
85 ui-options=
"{dropdownAutoWidth : true, allowClear: false, placeholder: ts('Email address')}"
86 ng-model=
"fromPlaceholder.label"
87 ng-options=
"frm.label as frm.label for frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'"
89 <option value=
""></option>
93 <div crm-ui-field=
"subform.fromAddressB" crm-title=
"ts('From (B)')" ng-if=
"fields.fromAddressB">
94 <span ng-controller=
"EmailAddrCtrl" crm-mailing-from-address=
"fromPlaceholder" crm-mailing=
"abtest.mailings.b">
96 crm-ui-id=
"subform.fromAddressB"
99 ui-options=
"{dropdownAutoWidth : true, allowClear: false, placeholder: ts('Email address')}"
100 ng-model=
"fromPlaceholder.label"
101 ng-options=
"frm.label as frm.label for frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'"
103 <option value=
""></option>
109 <div crm-ui-field=
"subform.replyTo" crm-title=
"ts('Reply-To')" ng-show=
"crmMailingConst.enableReplyTo" ng-if=
"fields.replyTo">
110 <span ng-controller=
"EmailAddrCtrl">
112 crm-ui-id=
"subform.replyTo"
115 ui-options=
"{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Email address')}"
116 ng-model=
"abtest.mailings.a.replyto_email"
117 ng-options=
"frm.label as frm.label for frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'"
119 <option value=
""></option>
123 <div crm-ui-field=
"subform.replyToA" crm-title=
"ts('Reply-To (A)')" ng-show=
"crmMailingConst.enableReplyTo" ng-if=
"fields.replyToA">
124 <span ng-controller=
"EmailAddrCtrl">
126 crm-ui-id=
"subform.replyToA"
129 ui-options=
"{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Email address')}"
130 ng-model=
"abtest.mailings.a.replyto_email"
131 ng-options=
"frm.label as frm.label for frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'"
133 <option value=
""></option>
137 <div crm-ui-field=
"subform.replyToB" crm-title=
"ts('Reply-To (B)')" ng-show=
"crmMailingConst.enableReplyTo" ng-if=
"fields.replyToB">
138 <span ng-controller=
"EmailAddrCtrl">
140 crm-ui-id=
"subform.replyToB"
143 ui-options=
"{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Email address')}"
144 ng-model=
"abtest.mailings.b.replyto_email"
145 ng-options=
"frm.label as frm.label for frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'"
147 <option value=
""></option>
153 <div crm-ui-field=
"subform.subject" crm-title=
"ts('Subject')" ng-if=
"fields.subject">
154 <div style=
"float: right;">
155 <input crm-mailing-token
crm-for=
"subform.subject" />
158 crm-ui-id=
"subform.subject"
160 class=
"crm-form-text"
161 ng-model=
"abtest.mailings.a.subject"
163 placeholder=
"Subject"
166 <div crm-ui-field=
"subform.subjectA" crm-title=
"ts('Subject (A)')" ng-if=
"fields.subjectA">
167 <div style=
"float: right;">
168 <input crm-mailing-token
crm-for=
"subform.subjectA" />
171 crm-ui-id=
"subform.subjectA"
173 class=
"crm-form-text"
174 ng-model=
"abtest.mailings.a.subject"
176 placeholder=
"Subject"
179 <div crm-ui-field=
"subform.subjectB" crm-title=
"ts('Subject (B)')" ng-if=
"fields.subjectB">
180 <div style=
"float: right;">
181 <input crm-mailing-token
crm-for=
"subform.subjectB" />
184 crm-ui-id=
"subform.subjectB"
186 class=
"crm-form-text"
187 ng-model=
"abtest.mailings.b.subject"
189 placeholder=
"Subject"