diff --git a/modules/tracker/Notification.php b/modules/tracker/Notification.php index 86d12c207..0859a771a 100644 --- a/modules/tracker/Notification.php +++ b/modules/tracker/Notification.php @@ -168,7 +168,14 @@ public function sendEmail($params) $producerDao = $trendDao->getProducer(); $fullUrl = UtilityComponent::getServerURL().$this->webroot; $email = $userDao->getEmail(); - $subject = 'Tracker Dashboard Threshold Notification'; + + $producerName = $producerDao->getDisplayName(); + $trendName = $trendDao->getDisplayName(); + $thresholdValue = $notification['value']; + $thresholdComparison = $notification['comparison']; + $scalarValue = $scalar['value']; + $subject = 'Threshold Alert: '.$producerName.': '.$trendName.' value '.$scalarValue.' '.$thresholdComparison.' '.$thresholdValue; + $body = 'Hello,

This email was sent because a submitted scalar value exceeded a threshold that you specified.

'; $body .= 'Community: '.htmlspecialchars($producerDao->getCommunity()->getName(), ENT_QUOTES, 'UTF-8').'
'; @@ -176,7 +183,19 @@ public function sendEmail($params) ).'">'.htmlspecialchars($producerDao->getDisplayName(), ENT_QUOTES, 'UTF-8').'
'; $body .= 'Trend: '.htmlspecialchars($trendDao->getDisplayName(), ENT_QUOTES, 'UTF-8').'
'; - $body .= 'Value: '.htmlspecialchars($scalar['value'], ENT_QUOTES, 'UTF-8'); + $body .= 'Visit the above Trend link to change or disable notifications.
'; + $body .= 'Value: '.htmlspecialchars($scalarValue, ENT_QUOTES, 'UTF-8').'
'; + $body .= 'Threshold: '.htmlspecialchars($thresholdComparison, ENT_QUOTES, 'UTF-8').' '.htmlspecialchars($thresholdValue, ENT_QUOTES, 'UTF-8').'
'; + + // Add gmail "View Action". + $trendTrackerUrl = $fullUrl.'/'.$this->moduleName.'/trend/view?trendId='.$trendDao->getKey(); + $body .= '
'; + $body .= '
'; + $body .= ' '; + $body .= ' '; + $body .= '
'; + $body .= ' '; + $body .= '
'; Zend_Registry::get('notifier')->callback( 'CALLBACK_CORE_SEND_MAIL_MESSAGE',