Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Yasinsky committed Mar 7, 2013
1 parent 7350150 commit 735b0ea
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once APP_PATH. 'models/oopzy_model.php';
require_once APP_PATH. 'models/Oopzy_model.php';

/*String*/ function _save_message()
{
Expand Down
19 changes: 7 additions & 12 deletions mail.oopzy.com/code/var/mail.oopzy.com/app/models/Oopzy_mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,9 @@
{
function send_email($from,$to,$subject,$message='',$message_html='')
{
// Create the Transport
if($GLOBALS['SMTP'] = 'basic')
{
$transport = Swift_SmtpTransport::newInstance($GLOBALS['SMTP_HOST'], $GLOBALS['SMTP_PORT']);
}
else
{
$transport = Swift_SmtpTransport::newInstance($GLOBALS['SMTP_HOST'], $GLOBALS['SMTP_PORT'], $GLOBALS['SMTP_SSL'])
$transport = Swift_SmtpTransport::newInstance($GLOBALS['SMTP_HOST'], $GLOBALS['SMTP_PORT'], $GLOBALS['SMTP_SSL'])
->setUsername($GLOBALS['SMTP_USER'])
->setPassword($GLOBALS['SMTP_PASSWORD']);
}

// Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);
Expand All @@ -34,10 +26,13 @@ function send_email($from,$to,$subject,$message='',$message_html='')
->setTo(array($to))

// Give it a body
->setBody($message)
->setBody($message);

// And optionally an alternative body
->addPart($message_html, 'text/html');
if(!empty($message_html))
{
// And optionally an alternative body
$msg->addPart($message_html, 'text/html');
}

$res = $mailer->send($msg);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,11 @@ public function do_remail_queue($ref, $box, $toemail)
$res_redis = $redis->setex($token, 60*10 , serialize( array('to'=>$obj,'for'=>$box)) ); //10 min ttl

#mailer
require_once('Oopzy_mail.php');
require_once APP_PATH. 'models/Oopzy_mail.php';

$mailer = new Oopzy_Mail();
$from = 'Info@' . $GLOBALS['host_name'];

$res_email = $mailer->send_email($from, $obj, $subject);
$res_email = $mailer->send_email($GLOBALS['mail_from'], $obj, $subject, $message,$message_html);

if(!$res_email)
{
Expand All @@ -91,7 +90,7 @@ public function do_remail_queue($ref, $box, $toemail)
return false;
}

if($res_redis && $res_mail)
if($res_redis && $res_email)
{
return true;
}
Expand Down
4 changes: 3 additions & 1 deletion mail.oopzy.com/code/var/mail.oopzy.com/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@
$GLOBALS['allowed_hosts'] = array('oopzy.com');
$GLOBALS['host_name'] = 'oopzy.com';

$GLOBALS['mail_from'] = 'mailer@oopzy.com';

$GLOBALS['PRIVATE_KEY'] = '#27drue';

$GLOBALS['www_host_name'] = 'mail.oopzy.com';

$GLOBALS['production'] = false;

$GLOBALS['REDISHOST'] = '50.116.26.97';
$GLOBALS['REDISHOST'] = 'oopzy.com';
$GLOBALS['REDISPORT'] = 6379;
$GLOBALS['REDISDB'] = 0;

Expand Down
2 changes: 2 additions & 0 deletions mail.oopzy.com/code/var/mail.oopzy.com/index.production.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
$GLOBALS['allowed_hosts'] = array('oopzy.com');
$GLOBALS['host_name'] = 'oopzy.com';

$GLOBALS['mail_from'] = 'mailer@oopzy.com';

$GLOBALS['PRIVATE_KEY'] = '#27drue';

$GLOBALS['www_host_name'] = 'www.oopzy.com';
Expand Down

0 comments on commit 735b0ea

Please sign in to comment.