BlockPreview.html 2.43 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
<!--
Vars: mailing:obj, testContact:obj, testGroup:obj, crmMailing:FormController
-->
<div class="form-group">
  <label>{{ts('Preview:')}}</label>
  <div ng-show="!mailing.body_html && !mailing.body_text">
    <em>({{ts('No content to preview')}})</em>
  </div>
  <div ng-hide="!mailing.body_html" class="btn-group btn-group-justified">
    <div class="btn-group">
      <button class="btn btn-primary" ng-disabled="crmMailing.$invalid" ng-click="doPreview('html')">{{ts('Preview as HTML')}}</button>
    </div>
  </div>
  <div ng-hide="!mailing.body_html && !mailing.body_text" style="margin-top: 1em;" class="btn-group btn-group-justified">
    <div class="btn-group">
      <button class="btn btn-primary" ng-disabled="crmMailing.$invalid" ng-click="doPreview('text')">{{ts('Preview as Plain Text')}}</button>
    </div>
  </div>
</div>

<div class="form-group">
  <label for="preview_test_email">{{ts('Send test email:')}} <a crm-ui-help="hs({id: 'test', title: ts('Test Email')})"></a> </label>
  <input
    name="preview_test_email"
    type="email"
    class="form-control margin-bottom-10"
    ng-model="testContact.email"
    placeholder="example@example.org" />
  <!--fa-paper-plane-->
  <button class="btn btn-sm btn-primary" title="{{crmMailing.$invalid || !testContact.email ? ts('Complete all required-mark fields first') : ts('Send test message to %1', {1: testContact.email})}}" ng-disabled="crmMailing.$invalid || !testContact.email" ng-click="doSend({email: testContact.email})">{{ts('Send test')}}</button>
</div>

<div class="form-group">
  <label for="preview_test_group">{{ts('Send test email to group:')}} <a crm-ui-help="hs({id: 'test', title: ts('Test Email')})"></a> </label>
  <select
    name="preview_test_group"
    ui-jq="crmSelect2"
    ui-options="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Select Group')}"
    ng-model="testGroup.gid"
40
    ng-options="group.id as group.title for group in groupNames|orderBy:'title'"
41 42 43 44 45 46 47
    class="form-control margin-bottom-10 full-width-force">
    <option value=""></option>
  </select>
  <!--fa-paper-plane-->
  <button class="btn btn-sm btn-primary" title="{{crmMailing.$invalid || !testGroup.gid ? ts('Complete all required-mark fields first') : ts('Send test message to group')}}" ng-disabled="crmMailing.$invalid || !testGroup.gid" crm-confirm="{resizable: true, width: '40%', height: '40%', open: previewTestGroup}"
      on-yes="doSend({gid: testGroup.gid})">{{ts('Send test')}}</button>
</div>