 Index: modules/janus/lib/Cron/Job/Abstract.php
 ===================================================================
---- modules/janus/lib/Cron/Job/Abstract.php	(revision 935)
+--- modules/janus/lib/Cron/Job/Abstract.php	(revision 937)
 +++ modules/janus/lib/Cron/Job/Abstract.php	(working copy)
-@@ -35,6 +35,38 @@
+@@ -35,6 +35,44 @@
          }
      }
  
 +    /**
++     * Notifies managing contact about updated metadata of entity
++     *
++     * @param   sspmod_janus_Entity $entity
 +     * @param   string $metadataXml
 +     * @return void
 +     */
-+    protected function _mailUpdatedMetaData($metadataXml) {
++    protected function _mailUpdatedMetaData(sspmod_janus_Entity $entity, $metadataXml) {
 +        $config = SimpleSAML_Configuration::getInstance();
 +        $time = date(DATE_RFC822);
-+        $url = SimpleSAML_Utilities::selfURL();
++        $entityName = $entity->getPrettyname();
++        $entityId   = $entity->getEntityId();
 +
 +        $message = <<<MESSAGE
 +<h1>Metadata Change detected</h1>
 +<p>Cron ran at $time</p>
-+<p>URL: <tt>$url</tt></p>
++<p>Name: $entityName</p>
++<p>EntityId: $entityId</p>
 +MESSAGE;
 +
-+        $toAddress = $config->getString('managingcontact_email', 'na@example.org');
-+        $subject = "Metadata Change detected for entity [name] ([entityID])";
++        $toAddress = $config->getString('managingcontact_email');
++        if (empty($toAddress)) {
++            SimpleSAML_Logger::error('Cron - Could not send email. [managingcontact_email] not set in config.');
++        }
 +
-+        if ($toAddress == 'na@example.org') {
-+            SimpleSAML_Logger::error('Cron - Could not send email. [managingcontact_email] not set in config.');
-+        } else {
-+            $email = new SimpleSAML_XHTML_EMail($toAddress, $subject, 'no-reply@example.edu');
-+            $email->setBody($message);
++        $fromAddress = 'no-reply@surfnet.nl';
++        $subject = "Metadata Change detected for entity " . $entity->getPrettyname() . " (" . $entity->getEntityId() . "])";
++        $email = new SimpleSAML_XHTML_EMail($toAddress, $subject, $fromAddress);
++        $email->setBody($message);
 +
-+            // Add gzipped metadata
-+            $attachmentContent  = gzencode($metadataXml);
-+            $email->addAttachment($attachmentContent, 'metadata.xml.gz', 'application/zip');
++        // Add gzipped metadata
++        $attachmentContent  = gzencode($metadataXml);
++        $attachmentFileName = 'metadata-' . $entityName . '.xml.gz';
++        $email->addAttachment($attachmentContent, $attachmentFileName, 'application/zip');
 +
-+            $email->send();
-+        }
++        $email->send();
 +    }
 +
      protected function _getHtmlForMessages($messages, $type)

                 if ($updated) {
-                    $entity->setParent($entity->getRevisionid());
-                    $entityController->saveEntity();
+                    $this->_mailUpdatedMetaData($xml);
 
                     $cronLogger->with($entityId)->notice(
                         "Entity updated"

         if (count($messages) > 0) {
Index: modules/janus/lib/Cron/Job/MetadataRefresh.php
===================================================================
--- modules/janus/lib/Cron/Job/MetadataRefresh.php	(revision 937)
+++ modules/janus/lib/Cron/Job/MetadataRefresh.php	(working copy)
@@ -142,8 +142,7 @@
                 }
