From c3f51c13d481726da17aadf1c5b6cad664f55865 Mon Sep 17 00:00:00 2001 From: Dave Greenberg Date: Fri, 11 Sep 2015 17:24:26 -0700 Subject: [PATCH] CRM-17207 - Use mailto link on contact summary when outbound email is disabled. ---------------------------------------- * CRM-17207: Use mailto link on contact summary emails if outbound email is disabled https://issues.civicrm.org/jira/browse/CRM-17207 --- CRM/Contact/Page/View/Summary.php | 3 +++ templates/CRM/Contact/Page/Inline/Email.tpl | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CRM/Contact/Page/View/Summary.php b/CRM/Contact/Page/View/Summary.php index 1744d8f591..832fe39696 100644 --- a/CRM/Contact/Page/View/Summary.php +++ b/CRM/Contact/Page/View/Summary.php @@ -140,6 +140,9 @@ class CRM_Contact_Page_View_Summary extends CRM_Contact_Page_View { $params['id'] = $params['contact_id'] = $this->_contactId; $params['noRelationships'] = $params['noNotes'] = $params['noGroups'] = TRUE; $contact = CRM_Contact_BAO_Contact::retrieve($params, $defaults, TRUE); + // Let summary page know if outbound mail is disabled so email links can be built conditionally + $mailingBackend = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME, 'mailing_backend'); + $this->assign('mailingOutboundOption', $mailingBackend['outBound_option']); $communicationType = array( 'phone' => array( diff --git a/templates/CRM/Contact/Page/Inline/Email.tpl b/templates/CRM/Contact/Page/Inline/Email.tpl index 838e5fc3f5..25b17e2aa0 100644 --- a/templates/CRM/Contact/Page/Inline/Email.tpl +++ b/templates/CRM/Contact/Page/Inline/Email.tpl @@ -49,9 +49,15 @@
{if !$item.on_hold and !$privacy.do_not_email} - + {if $mailingOutboundOption == 2} {* Outbound email is disabled, use a mailto link *} + {$item.email} - + + {else} + + {$item.email} + + {/if} {else} {$item.email} {/if} -- 2.25.1