cdab76cccbbe5215d33bff8ffb73034db901096b
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=
"{name: 'subform.msg_template_id', title: ts('Template')}" 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 crm-icon=
"disk" ng-click=
"saveTemplate(abtest.mailings.a)" class=
"crm-hover-button" title=
"{{ts('Save As')}}"></a>
33 <div crm-ui-field=
"{name: 'subform.msg_template_idA', title: ts('Template (A)')}" 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 crm-icon=
"disk" ng-click=
"saveTemplate(abtest.mailings.a)" class=
"crm-hover-button" title=
"{{ts('Save As')}}"></a>
48 <div crm-ui-field=
"{name: 'subform.msg_template_idB', title: ts('Template (B)')}" 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 crm-icon=
"disk" ng-click=
"saveTemplate(abtest.mailings.b)" class=
"crm-hover-button" title=
"{{ts('Save As')}}"></a>
65 <div crm-ui-field=
"{name: 'subform.fromAddress', title: ts('From'), help: hs('from_email')}" 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"
69 crm-ui-select=
"{dropdownAutoWidth : true, allowClear: false, placeholder: ts('Email address')}"
71 ng-model=
"fromPlaceholder.label"
73 <option value=
""></option>
74 <option ng-repeat=
"frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'" value=
"{{frm.label}}">{{frm.label}}
</option>
78 <div crm-ui-field=
"{name: 'subform.fromAddressA', title: ts('From (A)'), help: hs('from_email')}" ng-if=
"fields.fromAddressA">
79 <span ng-controller=
"EmailAddrCtrl" crm-mailing-from-address=
"fromPlaceholder" crm-mailing=
"abtest.mailings.a">
81 crm-ui-id=
"subform.fromAddressA"
82 crm-ui-select=
"{dropdownAutoWidth : true, allowClear: false, placeholder: ts('Email address')}"
84 ng-model=
"fromPlaceholder.label"
86 <option value=
""></option>
87 <option ng-repeat=
"frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'" value=
"{{frm.label}}">{{frm.label}}
</option>
91 <div crm-ui-field=
"{name: 'subform.fromAddressB', title: ts('From (B)'), help: hs('from_email')}" ng-if=
"fields.fromAddressB">
92 <span ng-controller=
"EmailAddrCtrl" crm-mailing-from-address=
"fromPlaceholder" crm-mailing=
"abtest.mailings.b">
94 crm-ui-id=
"subform.fromAddressB"
95 crm-ui-select=
"{dropdownAutoWidth : true, allowClear: false, placeholder: ts('Email address')}"
97 ng-model=
"fromPlaceholder.label"
99 <option value=
""></option>
100 <option ng-repeat=
"frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'" value=
"{{frm.label}}">{{frm.label}}
</option>
106 <div crm-ui-field=
"{name: 'subform.replyTo', title: ts('Reply-To')}" ng-show=
"crmMailingConst.enableReplyTo" ng-if=
"fields.replyTo">
107 <span ng-controller=
"EmailAddrCtrl">
109 crm-ui-id=
"subform.replyTo"
110 crm-ui-select=
"{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Email address')}"
112 ng-change=
"checkReplyToChange(abtest.mailings.a)"
113 ng-model=
"abtest.mailings.a.replyto_email"
115 <option value=
""></option>
116 <option ng-repeat=
"frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'" value=
"{{frm.label}}">{{frm.label}}
</option>
120 <div crm-ui-field=
"{name: 'subform.replyToA', title: ts('Reply-To (A)')}" ng-show=
"crmMailingConst.enableReplyTo" ng-if=
"fields.replyToA">
121 <span ng-controller=
"EmailAddrCtrl">
123 crm-ui-id=
"subform.replyToA"
124 crm-ui-select=
"{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Email address')}"
126 ng-change=
"checkReplyToChange(abtest.mailings.a)"
127 ng-model=
"abtest.mailings.a.replyto_email"
129 <option value=
""></option>
130 <option ng-repeat=
"frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'" value=
"{{frm.label}}">{{frm.label}}
</option>
134 <div crm-ui-field=
"{name: 'subform.replyToB', title: ts('Reply-To (B)')}" ng-show=
"crmMailingConst.enableReplyTo" ng-if=
"fields.replyToB">
135 <span ng-controller=
"EmailAddrCtrl">
137 crm-ui-id=
"subform.replyToB"
138 crm-ui-select=
"{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Email address')}"
140 ng-change=
"checkReplyToChange(abtest.mailings.b)"
141 ng-model=
"abtest.mailings.b.replyto_email"
143 <option value=
""></option>
144 <option ng-repeat=
"frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'" value=
"{{frm.label}}">{{frm.label}}
</option>
150 <div crm-ui-field=
"{name: 'subform.subject', title: ts('Subject')}" ng-if=
"fields.subject">
151 <div style=
"float: right;">
152 <input crm-mailing-token
on-select=
"$broadcast('insert:subject', token.name)" tabindex=
"-1"/>
155 crm-ui-id=
"subform.subject"
156 crm-ui-insert-rx=
"insert:subject"
158 class=
"crm-form-text"
159 ng-model=
"abtest.mailings.a.subject"
161 placeholder=
"Subject"
164 <div crm-ui-field=
"{name: 'subform.subjectA', title: ts('Subject (A)')}" ng-if=
"fields.subjectA">
165 <div style=
"float: right;">
166 <input crm-mailing-token
on-select=
"$broadcast('insert:subjectA', token.name)" tabindex=
"-1"/>
169 crm-ui-id=
"subform.subjectA"
170 crm-ui-insert-rx=
"insert:subjectA"
172 class=
"crm-form-text"
173 ng-model=
"abtest.mailings.a.subject"
175 placeholder=
"Subject"
178 <div crm-ui-field=
"{name: 'subform.subjectB', title: ts('Subject (B)')}" ng-if=
"fields.subjectB">
179 <div style=
"float: right;">
180 <input crm-mailing-token
on-select=
"$broadcast('insert:subjectB', token.name)" tabindex=
"-1"/>
183 crm-ui-id=
"subform.subjectB"
184 crm-ui-insert-rx=
"insert:subjectB"
186 class=
"crm-form-text"
187 ng-model=
"abtest.mailings.b.subject"
189 placeholder=
"Subject"