2 Controller: EditMailingCtrl
3 Required vars: mailing, crmMailingConst
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 <div class=
"crm-block" ng-form=
"subform" crm-ui-id-scope
>
8 <div class=
"crm-group">
9 <div crm-ui-field=
"subform.msg_template_id" crm-title=
"ts('Template')">
10 <div ng-controller=
"MsgTemplateCtrl">
12 crm-ui-id=
"subform.msg_template_id"
13 name=
"msg_template_id"
14 crm-ui-select=
"{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Message Template')}"
15 ng-model=
"mailing.msg_template_id"
16 ng-change=
"loadTemplate(mailing, mailing.msg_template_id)"
18 <option value=
""></option>
19 <option ng-repeat=
"frm in crmMsgTemplates.getAll() | orderBy:'msg_title'" ng-value=
"frm.id">{{frm.msg_title}}
</option>
21 <a crm-icon=
"disk" ng-click=
"saveTemplate(mailing)" class=
"crm-hover-button" title=
"{{ts('Save As')}}"></a>
24 <div crm-ui-field=
"subform.fromAddress" crm-title=
"ts('From')">
25 <div ng-controller=
"EmailAddrCtrl" crm-mailing-from-address=
"fromPlaceholder" crm-mailing=
"mailing">
27 crm-ui-id=
"subform.fromAddress"
28 crm-ui-select=
"{dropdownAutoWidth : true, allowClear: false, placeholder: ts('Email address')}"
30 ng-model=
"fromPlaceholder.label"
32 <option value=
""></option>
33 <option ng-repeat=
"frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'" value=
"{{frm.label}}">{{frm.label}}
</option>
37 <div crm-ui-field=
"subform.replyTo" crm-title=
"ts('Reply-To')" ng-show=
"crmMailingConst.enableReplyTo">
38 <div ng-controller=
"EmailAddrCtrl">
40 crm-ui-id=
"subform.replyTo"
41 crm-ui-select=
"{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Email address')}"
43 ng-change=
"checkReplyToChange(mailing)"
44 ng-model=
"mailing.replyto_email"
46 <option value=
""></option>
47 <option ng-repeat=
"frm in crmFromAddresses.getAll() | filter:{is_active:1} | orderBy:'weight'" value=
"{{frm.label}}">{{frm.label}}
</option>
51 <div crm-ui-field=
"subform.recipients" crm-title=
"ts('Recipients')">
52 <div crm-mailing-block-recipients=
"{name: 'recipients', id: 'subform.recipients'}" crm-mailing=
"mailing"></div>
54 <span ng-controller=
"EditUnsubGroupCtrl">
55 <div crm-ui-field=
"subform.baseGroup" crm-title=
"ts('Unsubscribe Group')" ng-if=
"isUnsubGroupRequired(mailing)">
57 crm-ui-id=
"subform.baseGroup"
60 ng-model=
"mailing.recipients.groups.base[0]"
63 <option ng-repeat=
"grp in crmMailingConst.groupNames | filter:{visibility:'Public pages'}" value=
"{{grp.id}}">{{grp.title}}
</option>
67 <div crm-ui-field=
"subform.subject" crm-title=
"ts('Subject')">
68 <div style=
"float: right;">
69 <input crm-mailing-token
on-select=
"$broadcast('insert:subject', token.name)" tabindex=
"-1"/>
72 crm-ui-id=
"subform.subject"
73 crm-ui-insert-rx=
"insert:subject"
76 ng-model=
"mailing.subject"