Commit cddc6a72 authored by Chris's avatar Chris

whitespace

parent f4fc2e9f
.idea/
.modgit/
app/code/community/Find/
app/code/community/Phoenix/
......
......@@ -8,6 +8,5 @@ class FreeLunchLabs_MailGun_Block_Adminhtml_Customer_Email extends Mage_Adminhtm
$this->_blockGroup = 'freelunchlabs_mailgun';
$this->_controller = 'adminhtml_customer_email';
$this->_headerText = false;
}
}
\ No newline at end of file
......@@ -22,7 +22,6 @@ class FreeLunchLabs_MailGun_Block_Adminhtml_Customer_Email_Grid extends Mage_Adm
}
protected function _prepareColumns() {
$this->addColumn('subject', array(
'header' => 'Subject',
'type' => 'text',
......
......@@ -8,6 +8,5 @@ class FreeLunchLabs_MailGun_Block_Adminhtml_Event_Container extends Mage_Adminht
$this->_blockGroup = 'freelunchlabs_mailgun';
$this->_controller = 'adminhtml_event';
$this->_headerText = false;
}
}
\ No newline at end of file
......@@ -14,13 +14,12 @@ class FreeLunchLabs_MailGun_Block_Adminhtml_Event_Grid extends Mage_Adminhtml_Bl
protected function _prepareCollection() {
$collection = Mage::getResourceModel('freelunchlabs_mailgun/event_collection');
$collection->addFieldToFilter('email_id', Mage::registry('current_email')->getId());
$this->setCollection($collection);
return parent::_prepareCollection();
}
protected function _prepareColumns() {
$this->addColumn('event_type', array(
'header' => 'Event',
'index' => 'event_type',
......
<?php
class FreeLunchLabs_MailGun_Block_Adminhtml_Event_Renderer_Timestamp extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
{
public function render(Varien_Object $row)
{
public function render(Varien_Object $row) {
$value = $row->getData($this->getColumn()->getIndex());
$date = Mage::getSingleton('core/date')->timestamp($value);
return Mage::helper('core')->formatDate(new Zend_Date($date), 'medium', true);
}
}
\ No newline at end of file
<?php
class FreeLunchLabs_MailGun_Block_Adminhtml_Event_Renderer_Type extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
{
public function render(Varien_Object $row)
{
public function render(Varien_Object $row) {
$value = $row->getData($this->getColumn()->getIndex());
return ucwords($value);
}
}
\ No newline at end of file
......@@ -8,6 +8,5 @@ class FreeLunchLabs_MailGun_Block_Adminhtml_Global_Container extends Mage_Adminh
$this->_blockGroup = 'freelunchlabs_mailgun';
$this->_controller = 'adminhtml_global';
$this->_headerText = false;
}
}
\ No newline at end of file
......@@ -13,13 +13,12 @@ class FreeLunchLabs_MailGun_Block_Adminhtml_Global_Grid extends Mage_Adminhtml_B
protected function _prepareCollection() {
$collection = Mage::getResourceModel('freelunchlabs_mailgun/email_collection')->getGridCollection();
$this->setCollection($collection);
return parent::_prepareCollection();
}
protected function _prepareColumns() {
$this->addColumn('subject', array(
'header' => 'Subject',
'type' => 'text',
......
......@@ -4,7 +4,7 @@ class FreeLunchLabs_MailGun_Model_Email_Template extends Mage_Core_Model_Email_T
var $bcc = null;
var $replyto = null;
var $returnPath = null; //This is not used because MailGun overides it for their internal purposes.
var $returnPath = null; //This is not used because MailGun overrides it for their internal purposes.
public function send($email, $name = null, array $variables = array()) {
//Get appropriate store
......@@ -125,17 +125,19 @@ class FreeLunchLabs_MailGun_Model_Email_Template extends Mage_Core_Model_Email_T
public function addBcc($bcc) {
$this->bcc = $bcc;
return parent::addBcc($bcc);
}
public function setReturnPath($email) {
$this->returnPath = $email;
return parent::setReturnPath($email);
}
public function setReplyTo($email) {
$this->replyto = $email;
return parent::setReplyTo($email);
}
......
<?php
class FreeLunchLabs_MailGun_Model_Exceptions_InvalidParameter extends \Exception{}
?>
\ No newline at end of file
<?php
class FreeLunchLabs_MailGun_Model_Exceptions_InvalidParameterType extends \Exception{}
?>
\ No newline at end of file
<?php
class FreeLunchLabs_MailGun_Model_Exceptions_MissingRequiredMIMEParameters extends \Exception{}
?>
\ No newline at end of file
<?php
class FreeLunchLabs_MailGun_Model_Exceptions_TooManyParameters extends \Exception{}
?>
\ No newline at end of file
......@@ -5,7 +5,6 @@ class FreeLunchLabs_MailGun_Model_Mailgun extends Mage_Core_Model_Abstract {
public $apiUrl = "https://api.mailgun.net/v2/";
public function mailgunRequest($type, $domain, $apiKey, $data, $method = Zend_Http_Client::GET, $uriOveride = false, $files = null) {
$client = new Zend_Http_Client();
$client->setAuth("api", $apiKey);
$client->setMethod($method);
......@@ -47,7 +46,6 @@ class FreeLunchLabs_MailGun_Model_Mailgun extends Mage_Core_Model_Abstract {
}
public function send($message) {
$domain = $message->getStore()->getConfig('mailgun/general/domain');
$apiKey = $message->getStore()->getConfig('mailgun/general/key');
$files = null;
......@@ -68,7 +66,6 @@ class FreeLunchLabs_MailGun_Model_Mailgun extends Mage_Core_Model_Abstract {
}
public function processEmailEventsForAllStores() {
$stores = Mage::getModel('core/store')->getCollection();
foreach($stores as $store) {
......@@ -79,7 +76,6 @@ class FreeLunchLabs_MailGun_Model_Mailgun extends Mage_Core_Model_Abstract {
}
public function processEmailEventsForSingleStore(Mage_Core_Model_Store $store) {
if($store->getConfig('mailgun/events/store')) {
$data = array(
......
......@@ -26,19 +26,25 @@ class FreeLunchLabs_MailGun_Model_Messagebuilder extends Varien_Object {
protected $variables = array();
protected $files = array();
protected $attachments = array();
protected $counters = array('recipients' => array('to' => 0,
protected $counters = array(
'recipients' => array(
'to' => 0,
'cc' => 0,
'bcc' => 0),
'attributes' => array('attachment' => 0,
'bcc' => 0,
),
'attributes' => array(
'attachment' => 0,
'campaign_id' => 0,
'custom_option' => 0,
'tag' => 0)
'tag' => 0,
),
);
protected function safeGet($params, $key, $default) {
if (array_key_exists($key, $params)) {
return $params[$key];
}
return $default;
}
......@@ -48,6 +54,7 @@ class FreeLunchLabs_MailGun_Model_Messagebuilder extends Varien_Object {
$last = $this->safeGet($params, "last", "");
return trim("$first $last");
}
return $this->safeGet($params, "full_name", "");
}
......@@ -59,6 +66,7 @@ class FreeLunchLabs_MailGun_Model_Messagebuilder extends Varien_Object {
if ($fullName != null) {
return "'$fullName' <$address>";
}
return $address;
}
......@@ -82,6 +90,7 @@ class FreeLunchLabs_MailGun_Model_Messagebuilder extends Varien_Object {
throw new FreeLunchLabs_MailGun_Model_Exceptions_TooManyParameters(TOO_MANY_PARAMETERS_RECIPIENT);
}
$this->addRecipient("to", $address, $variables);
return end($this->message['to']);
}
......@@ -90,6 +99,7 @@ class FreeLunchLabs_MailGun_Model_Messagebuilder extends Varien_Object {
throw new FreeLunchLabs_MailGun_Model_Exceptions_TooManyParameters(TOO_MANY_PARAMETERS_RECIPIENT);
}
$this->addRecipient("cc", $address, $variables);
return end($this->message['cc']);
}
......@@ -98,16 +108,19 @@ class FreeLunchLabs_MailGun_Model_Messagebuilder extends Varien_Object {
throw new FreeLunchLabs_MailGun_Model_Exceptions_TooManyParameters(TOO_MANY_PARAMETERS_RECIPIENT);
}
$this->addRecipient("bcc", $address, $variables);
return end($this->message['bcc']);
}
public function setFromAddress($address, $variables = null) {
$this->addRecipient("from", $address, $variables);
return $this->message['from'];
}
public function setReplyToAddress($address, $variables = null) {
$this->addRecipient("h:reply-to", $address, $variables);
return $this->message['h:reply-to'];
}
......@@ -116,6 +129,7 @@ class FreeLunchLabs_MailGun_Model_Messagebuilder extends Varien_Object {
$subject = " ";
}
$this->message['subject'] = $subject;
return $this->message['subject'];
}
......@@ -128,6 +142,7 @@ class FreeLunchLabs_MailGun_Model_Messagebuilder extends Varien_Object {
$headerName = "h:" . $headerName;
}
$this->message[$headerName] = array($headerData);
return $this->message[$headerName];
}
......@@ -136,6 +151,7 @@ class FreeLunchLabs_MailGun_Model_Messagebuilder extends Varien_Object {
$textBody = " ";
}
$this->message['text'] = $textBody;
return $this->message['text'];
}
......@@ -144,6 +160,7 @@ class FreeLunchLabs_MailGun_Model_Messagebuilder extends Varien_Object {
$htmlBody = " ";
}
$this->message['html'] = $htmlBody;
return $this->message['html'];
}
......@@ -187,6 +204,7 @@ class FreeLunchLabs_MailGun_Model_Messagebuilder extends Varien_Object {
$testMode = "no";
}
$this->message['o:testmode'] = $testMode;
return $this->message['o:testmode'];
}
......@@ -225,6 +243,7 @@ class FreeLunchLabs_MailGun_Model_Messagebuilder extends Varien_Object {
$enabled = "no";
}
$this->message["o:dkim"] = $enabled;
return $this->message["o:dkim"];
}
......@@ -235,6 +254,7 @@ class FreeLunchLabs_MailGun_Model_Messagebuilder extends Varien_Object {
$enabled = "no";
}
$this->message['o:tracking-opens'] = $enabled;
return $this->message['o:tracking-opens'];
}
......@@ -247,6 +267,7 @@ class FreeLunchLabs_MailGun_Model_Messagebuilder extends Varien_Object {
$enabled = "no";
}
$this->message['o:tracking-clicks'] = $enabled;
return $this->message['o:tracking-clicks'];
}
......@@ -260,6 +281,7 @@ class FreeLunchLabs_MailGun_Model_Messagebuilder extends Varien_Object {
$dateTimeObj = new DateTime($timeDate, $timeZoneObj);
$formattedTimeDate = $dateTimeObj->format(DateTime::RFC2822);
$this->message['o:deliverytime'] = $formattedTimeDate;
return $this->message['o:deliverytime'];
}
......
......@@ -2,8 +2,7 @@
class FreeLunchLabs_MailGun_Adminhtml_EmailtrackingController extends Mage_Adminhtml_Controller_Action {
protected function _initCustomer($idFieldName = 'id')
{
protected function _initCustomer($idFieldName = 'id') {
$this->_title($this->__('Customers'))->_title($this->__('Manage Customers'));
$customerId = (int) $this->getRequest()->getParam($idFieldName);
......@@ -29,8 +28,7 @@ class FreeLunchLabs_MailGun_Adminhtml_EmailtrackingController extends Mage_Admin
return $this;
}
public function emailGridAction()
{
public function emailGridAction() {
$this->_initCustomer();
$this->loadLayout();
$gridBlock = $this->getLayout()->createBlock('freelunchlabs_mailgun/adminhtml_customer_email');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment