| 1 |
<?php |
| 2 |
|
| 3 |
// Files can easily get way too big for this method |
| 4 |
|
| 5 |
class UpdraftPlus_BackupModule_email { |
| 6 |
|
| 7 |
function backup($backup_array) { |
| 8 |
|
| 9 |
global $updraftplus; |
| 10 |
|
| 11 |
foreach ($backup_array as $type => $file) { |
| 12 |
$fullpath = trailingslashit(UpdraftPlus_Options::get_updraft_option('updraft_dir')).$file; |
| 13 |
wp_mail(UpdraftPlus_Options::get_updraft_option('updraft_email'), "WordPress Backup ".date('Y-m-d H:i',$updraftplus->backup_time), "Backup is of the $type. Be wary; email backups may fail because of file size limitations on mail servers.", null, array($fullpath)); |
| 14 |
$updraftplus->uploaded_file($file); |
| 15 |
} |
| 16 |
$updraftplus->prune_retained_backups("email", null, null); |
| 17 |
} |
| 18 |
|
| 19 |
public static function config_print() { |
| 20 |
?> |
| 21 |
<tr class="updraftplusmethod email"> |
| 22 |
<th>Note:</th> |
| 23 |
<td>The email address entered above will be used. If choosing "E-Mail", then be aware that mail servers tend to have size limits; typically around 10-20Mb; backups larger than any limits will not arrive. If you really need a large backup via email, then you could fund a new feature (to break the backup set into configurable-size pieces) - but the demand has not yet existed for such a feature.</td> |
| 24 |
</tr> |
| 25 |
<?php |
| 26 |
} |
| 27 |
|
| 28 |
} |
| 29 |
|
| 30 |
?> |