summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
authorEric Barnes <eric@ericlbarnes.com>2012-07-30 14:10:05 +0200
committerEric Barnes <eric@ericlbarnes.com>2012-07-30 14:10:05 +0200
commit4df0be86a3ee120e307d6140a9106e77a4962bb0 (patch)
tree901d005b951e11b17973fe2f3e4171dda04340b3 /system/libraries
parentb92c44bba729575a92c80313174d45191cae582e (diff)
parent5f441eaedf5fecbad29131c5d44e3c2d53c4c4b5 (diff)
Merge pull request #1672 from alexbilbie/alexbilbie-email-clear
Automatically clear email parameters if send was successful
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Email.php20
1 files changed, 17 insertions, 3 deletions
diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index fdb9be4da..196a4b36c 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -1238,7 +1238,7 @@ class CI_Email {
*
* @return bool
*/
- public function send()
+ public function send($auto_clear = TRUE)
{
if ($this->_replyto_flag === FALSE)
{
@@ -1257,11 +1257,25 @@ class CI_Email {
if ($this->bcc_batch_mode && count($this->_bcc_array) > $this->bcc_batch_size)
{
- return $this->batch_bcc_send();
+ $result = $this->batch_bcc_send();
+
+ if ($result && $auto_clear)
+ {
+ $this->clear();
+ }
+
+ return $result;
}
$this->_build_message();
- return $this->_spool_email();
+ $result = $this->_spool_email();
+
+ if ($result && $auto_clear)
+ {
+ $this->clear();
+ }
+
+ return $result;
}
// --------------------------------------------------------------------