2 +--------------------------------------------------------------------+
3 | Copyright CiviCRM LLC. All rights reserved. |
5 | This work is published under the GNU AGPLv3 license with some |
6 | permitted exceptions and without any warranty. For full license |
7 | and copyright information, see https://civicrm.org/licensing |
8 +--------------------------------------------------------------------+
10 <div class="crm-block crm-form-block crm-contactEmail-form-block">
11 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
12 {if $suppressedEmails > 0}
14 <p>{ts count=$suppressedEmails plural='Email will NOT be sent to %count contacts - (no email address on file, or communication preferences specify DO NOT EMAIL, or contact is deceased).'}Email will NOT be sent to %count contact - (no email address on file, or communication preferences specify DO NOT EMAIL, or contact is deceased).{/ts}</p>
17 {crmSetting var="logged_in_email_setting" name="allow_mail_from_logged_in_contact"}
18 <table class="form-layout-compressed">
19 <tr id="selectEmailFrom" class="crm-contactEmail-form-block-fromEmailAddress crm-email-element">
20 <td class="label">{$form.from_email_address.label}</td>
21 <td>{$form.from_email_address.html} {help id="id-from_email" file="CRM/Contact/Form/Task/Email.hlp" isAdmin=$isAdmin logged_in_email_setting=$logged_in_email_setting}</td>
23 <tr class="crm-contactEmail-form-block-recipient">
24 <td class="label">{if $single eq false}{ts}Recipient(s){/ts}{else}{$form.to.label}{/if}</td>
26 {$form.to.html} {help id="id-to_email" file="CRM/Contact/Form/Task/Email.hlp"}
29 <tr class="crm-contactEmail-form-block-cc_id" {if !$form.cc_id.value}style="display:none;"{/if}>
30 <td class="label">{$form.cc_id.label}</td>
33 <a class="crm-hover-button clear-cc-link" rel="cc_id" title="{ts}Clear{/ts}" href="#"><i class="crm-i fa-times" aria-hidden="true"></i></a>
36 <tr class="crm-contactEmail-form-block-bcc_id" {if !$form.bcc_id.value}style="display:none;"{/if}>
37 <td class="label">{$form.bcc_id.label}</td>
40 <a class="crm-hover-button clear-cc-link" rel="bcc_id" title="{ts}Clear{/ts}" href="#"><i class="crm-i fa-times" aria-hidden="true"></i></a>
47 <a href="#" rel="cc_id" class="add-cc-link crm-hover-button" {if $form.cc_id.value}style="display:none;"{/if}>{ts}Add CC{/ts}</a>
48 <a href="#" rel="bcc_id" class="add-cc-link crm-hover-button" {if $form.bcc_id.value}style="display:none;"{/if}>{ts}Add BCC{/ts}</a>
54 <tr class="crm-contactEmail-form-block-template">
55 <td class="label">{$form.template.label}</td>
56 <td>{$form.template.html}</td>
59 <tr class="crm-contactEmail-form-block-subject">
60 <td class="label">{$form.subject.label}</td>
62 {$form.subject.html|crmAddClass:huge}
63 <input class="crm-token-selector big" data-field="subject" />
64 {help id="id-token-subject" tplFile=$tplFile isAdmin=$isAdmin file="CRM/Contact/Form/Task/Email.hlp"}
67 {* CRM-15984 --add campaign to email activities *}
68 {include file="CRM/Campaign/Form/addCampaignToComponent.tpl" campaignTrClass="crm-contactEmail-form-block-campaign_id"}
71 {include file="CRM/Contact/Form/Task/EmailCommon.tpl"}
72 {include file="CRM/Activity/Form/FollowUp.tpl" type='email-'}
74 <div class="spacer"> </div>
77 {include file="CRM/Contact/Form/Task.tpl"}
79 {if $suppressedEmails > 0}
80 {ts count=$suppressedEmails plural='Email will NOT be sent to %count contacts.'}Email will NOT be sent to %count contact.{/ts}
82 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
84 <script type="text/javascript">
88 var $form = $("form.{/literal}{$form.formClass}{literal}");
90 $('.add-cc-link', $form).click(function(e) {
92 var type = $(this).attr('rel');
94 $('.crm-contactEmail-form-block-'+type, $form).show();
97 $('.clear-cc-link', $form).click(function(e) {
99 var type = $(this).attr('rel');
100 $('.add-cc-link[rel='+type+']', $form).show();
101 $('.crm-contactEmail-form-block-'+type, $form).hide().find('input.crm-ajax-select').select2('data', []);
104 var sourceDataUrl = "{/literal}{crmURL p='civicrm/ajax/checkemail' q='id=1' h=0 }{literal}";
106 function emailSelect(el, prepopulate) {
107 $(el, $form).data('api-entity', 'contact').css({width: '40em', 'max-width': '90%'}).crmSelect2({
108 minimumInputLength: 1,
112 data: function(term) {
117 results: function(response) {
123 }).select2('data', prepopulate);
127 var toContact = {if $toContact}{$toContact}{else}''{/if};
129 emailSelect('#to', toContact);