Permalink
Browse files

cleaned up some of the mail methods

  • Loading branch information...
CJ Buchmann
CJ Buchmann committed Feb 14, 2012
1 parent dd5dac0 commit 4edeb89e1082262912c78de09171ab32699a34c1
Showing with 55 additions and 55 deletions.
  1. +55 −55 SendGrid/Mail.php
View
@@ -159,61 +159,6 @@ public function setCcs(array $email_list)
$this->cc_list = $email_list;
return $this;
}
-
- /**
- * useHeaders
- * Checks to see whether or not we can or should you headers. In most cases,
- * we prefer to send our recipients through the headers, but in some cases,
- * we actually don't want to. However, there are certain circumstances in
- * which we have to.
- */
- public function useHeaders()
- {
- return !($this->_preferNotToUseHeaders() && !$this->_isHeadersRequired());
- }
-
- public function setRecipientsInHeader($preference)
- {
- $this->use_headers = $preference;
-
- return $this;
- }
-
- /**
- * isHeaderRequired
- * determines whether or not we need to force recipients through the smtpapi headers
- * @return boolean, if true headers are required
- */
- private function _isHeadersRequired()
- {
- if(count($this->getAttachments()) > 0 || $this->use_headers )
- {
- return true;
- }
- return false;
- }
-
- /**
- * _preferNotToUseHeaders
- * There are certain cases in which headers are not a preferred choice
- * to send email, as it limits some basic email functionality. Here, we
- * check for any of those rules, and add them in to decide whether or
- * not to use headers
- * @return boolean, if true we don't
- */
- private function _preferNotToUseHeaders()
- {
- if (count($this->getBccs()) > 0 || count($this->getCcs()) > 0 || ($this->use_headers !== null && !$this->use_headers))
- {
- return true;
- }
- return false;
- }
-
- public function forceHeaders()
- {
-
- }
/**
* setCc
@@ -667,4 +612,59 @@ public function removeHeader($key)
return $this;
}
+ /**
+ * useHeaders
+ * Checks to see whether or not we can or should you headers. In most cases,
+ * we prefer to send our recipients through the headers, but in some cases,
+ * we actually don't want to. However, there are certain circumstances in
+ * which we have to.
+ */
+ public function useHeaders()
+ {
+ return !($this->_preferNotToUseHeaders() && !$this->_isHeadersRequired());
+ }
+
+ public function setRecipientsInHeader($preference)
+ {
+ $this->use_headers = $preference;
+
+ return $this;
+ }
+
+ /**
+ * isHeaderRequired
+ * determines whether or not we need to force recipients through the smtpapi headers
+ * @return boolean, if true headers are required
+ */
+ protected function _isHeadersRequired()
+ {
+ if(count($this->getAttachments()) > 0 || $this->use_headers )
+ {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * _preferNotToUseHeaders
+ * There are certain cases in which headers are not a preferred choice
+ * to send email, as it limits some basic email functionality. Here, we
+ * check for any of those rules, and add them in to decide whether or
+ * not to use headers
+ * @return boolean, if true we don't
+ */
+ protected function _preferNotToUseHeaders()
+ {
+ if (count($this->getBccs()) > 0 || count($this->getCcs()) > 0)
+ {
+ return true;
+ }
+ if ($this->use_headers !== null && !$this->use_headers)
+ {
+ return true;
+ }
+
+ return false;
+ }
+
}

0 comments on commit 4edeb89

Please sign in to comment.