Browse files

E-mail views are saved in the database

  • Loading branch information...
1 parent 0520bb3 commit ca355b4271cb2d310483c4329ae07d629674df47 @soonick committed Nov 11, 2010
Showing with 26 additions and 13 deletions.
  1. +4 −0 .htaccess
  2. +0 −1 attachments/index.php
  3. +18 −7 classes/Pommo_Mailer.php
  4. +2 −2 classes/Pommo_Mailing.php
  5. +2 −3 track_view.php
View
4 .htaccess
@@ -0,0 +1,4 @@
+RewriteEngine On
+
+RewriteRule ^track-([0-9]+)-([0-9]+).png$ track_view.php?mailing=$1&subscriber=$2
+
View
1 attachments/index.php
@@ -1 +0,0 @@
-<?php die(); ?>

You nuked the attachments directory with this commit, cause git only handles files not directories. You need at least an empty .gitignore file and commit that to have the directory in the repo.

@soonick
Owner
soonick added a note Nov 27, 2010

Thank you for pointing that out. Will do it right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
View
25 classes/Pommo_Mailer.php
@@ -256,9 +256,16 @@ function prepareMail($subject = NULL, $body = NULL, $HTML = FALSE,
return TRUE;
}
- // ** SEND MAIL FUNCTION --> pass an array of senders, or a single email
- // address for single mode
- // TODO rename function send in order to not confuse w/ PHPMailer's Send()?
+ /* bmSendmail
+ * ** SEND MAIL FUNCTION --> pass an array of senders, or a single email
+ * address for single mode
+ * TODO rename function send in order to not confuse w/ PHPMailer's Send()?
+ *
+ * @param mixed $to.- E-mail address or array with addresses
+ * @param boolean $subscriber
+ *
+ * @return boolean True on success
+ */
function bmSendmail(&$to, $subscriber = FALSE)
{
if ($this->_validated == FALSE)
@@ -287,7 +294,6 @@ function bmSendmail(&$to, $subscriber = FALSE)
// check for personalization personaliztion and override message body
if ($this->_personalize)
{
- global $pommo;
$this->Body = Pommo_Helper_Personalize::replace(
$this->_body, $subscriber,
Pommo::$_session['personalization_body']);
@@ -323,13 +329,18 @@ function bmSendmail(&$to, $subscriber = FALSE)
// incorporate BCC+Enveloping in here if type is SMTP
// TODO Play w/ the size limiting of arrays sent here
}
- } else {
- $this->logger->addMsg(sprintf(Pommo::_T("Mail to: %s not sent. Demonstration mode is active."),(is_array($to)) ? implode(',', $to) : $to));
+ }
+ else
+ {
+ $this->logger->addMsg(sprintf(Pommo::_T(
+ "Mail to: %s not sent. Demonstration mode is active."),
+ (is_array($to)) ? implode(',', $to) : $to));
return true;
}
// if message(s) exist, return false. (Sending failed w/ error messages)
- if (!empty ($errors)) {
+ if (!empty ($errors))
+ {
$this->logger->addMsg($errors);
return false;
}
View
4 classes/Pommo_Mailing.php
@@ -276,8 +276,8 @@ function add(&$in)
if (1 == $in['track'])
{
$in['body'] .= '<img src="http://'.$_SERVER['SERVER_NAME'].
- Pommo::$_baseUrl.'track_view.php?'.
- 'mailing=[mailing_id]&subscriber=[subscriber_id]">';
+ Pommo::$_baseUrl.'track-[[!mailing_id]]-[[!subscriber_id]]'.
+ '.png">';
}
$query = "INSERT INTO ".$dbo->table['mailings']."
View
5 track_view.php
@@ -22,14 +22,13 @@
INITIALIZATION METHODS
*********************************/
require('bootstrap.php');
-Pommo::init();
require_once ("classes/Pommo_Mailing.php");
-Pommo_Mailing::saveHit(1, 1);
+Pommo_Mailing::saveHit($_GET['mailing'], $_GET['subscriber']);
header('Content-type: image/png');
echo gzinflate(base64_decode('6wzwc+flkuJiYGDg9fRwCQLSjCDMwQQkJ5QH3wNSb'
.'CVBfsEMYJC3jH0ikOLxdHEMqZiTnJCQAOSxMDB+E7cIBcl7uvq5rHNKaAIA'));
-
+

0 comments on commit ca355b4

Please sign in to comment.