]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
send backup files
authorEvan Prodromou <evan@status.net>
Fri, 7 Oct 2011 13:36:52 +0000 (09:36 -0400)
committerEvan Prodromou <evan@status.net>
Fri, 7 Oct 2011 13:36:52 +0000 (09:36 -0400)
plugins/OfflineBackup/offlinebackupqueuehandler.php

index 81b29c43bc54912eaa69948b37e20542120702e0..383a43d759f1396ddeccb7b7c778dcaeb4c929a9 100644 (file)
@@ -60,7 +60,7 @@ class OfflineBackupQueueHandler extends QueueHandler
 
         $fileName = $this->makeBackupFile($user);
 
-        $this->notifyBackupFile($fileName);
+        $this->notifyBackupFile($user, $fileName);
 
         return true;
     }
@@ -79,8 +79,19 @@ class OfflineBackupQueueHandler extends QueueHandler
         return $fileName;
     }
 
-    function notifyBackupFile($fileName)
+    function notifyBackupFile($user, $fileName)
     {
-        $fileUrl = 
+        $fileUrl = File::url($fileName);
+
+        $body = sprintf(_m("The backup file you requested is ready for download.\n\n".
+                           "%s\n".
+                           "Thanks for your time,\n",
+                           "%s\n"),
+                        $fileUrl,
+                        common_config('site', 'name'));
+
+        $headers = _mail_prepare_headers('offlinebackup', $user->nickname, $user->nickname);
+
+        mail_to_user($user, _('Backup file ready for download'), $body, $headers);
     }
 }