From 8411673a282c5ad24cdc5560e5e018e3db7ea5fd Mon Sep 17 00:00:00 2001 From: davehauenstein Date: Mon, 20 Apr 2009 21:39:12 +0000 Subject: reply-to email header is now set to the user who sent the link git-svn-id: http://arc90labs-readability.googlecode.com/svn/trunk@40 d4e419ec-0920-11de-bbfd-a7c1bc4c261e --- email.php | 49 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 15 deletions(-) (limited to 'email.php') diff --git a/email.php b/email.php index 4791fc1..9f7404a 100644 --- a/email.php +++ b/email.php @@ -1,5 +1,5 @@ filter($_POST['from']); + $fromName = $filters->filter($_POST['name']); + $fromName = !empty($fromName) ? $fromName : $from; $to = $filters->filter($_POST['to']); $to = array_map('trim', split(',', $to)); $note = $filters->filter($_POST['note']); @@ -72,6 +74,7 @@ { // store the from address so it's saved for future use setcookie("from", $from, time()+3600*24*7*4, "/"); + setcookie("name", $fromName, time()+3600*24*7*4, "/"); require_once 'Zend/Mail.php'; require_once 'Zend/Mail/Transport/Smtp.php'; @@ -79,7 +82,7 @@ $mailer = new Zend_Mail_Transport_Smtp('smtp.googlemail.com', Array( 'auth' => 'login', 'username' => 'readability@arc90.com', - 'password' => '*******', + 'password' => '********', 'ssl' => 'ssl', 'port' => 465, )); @@ -91,7 +94,10 @@ $body = ''; $body .= '
'; $body .= '

This page was sent to you by: '.$from.'

'; - $body .= '

Message from sender:

'.stripslashes($note).'

'; + if(!empty($note)) + { + $body .= '

Message from sender:

'.stripslashes($note).'

'; + } $body .= '

Just click this link: '.$pageTitle.'

'; $body .= '
'; $body .= '

Sent from Readability | An Arc90 lab experiment

'; @@ -100,7 +106,8 @@ $mail = new Zend_Mail(); $mail->setBodyHtml($body); - $mail->setFrom($from); + $mail->setFrom($from, $fromName); + $mail->addHeader('Reply-To', $from); foreach($to as $toAddress) { @@ -234,7 +241,7 @@ public static function hasValidParams() { - $requiredParams = array('from', 'to', 'note', 'key', 'pageTitle', 'pageUrl'); + $requiredParams = array('from', 'name', 'to', 'note', 'key', 'pageTitle', 'pageUrl'); $sentParams = array_keys($_POST); foreach($requiredParams as $required) { @@ -277,8 +284,8 @@ font-size: 14px; margin: 0; padding: 0; - width: 480px; - height: 450px; + width: 500px; + height: 490px; font-family: times, serif; background-color: #fff; } @@ -296,13 +303,13 @@ padding-right: 10px; display: block; float: left; - width: 100px; + width: 130px; text-align: right; } input, textarea{ padding: 5px; - width: 330px; + width: 320px; font-family: times, serif; font-size: 14px; border: solid 1px #999; @@ -325,7 +332,7 @@ } .helper, .details{ - margin-left: 110px; /* add label width + label padding-right */ + margin-left: 120px; /* add label width + label padding-right */ } .section{ margin-top: 15px; @@ -360,12 +367,17 @@ bottom: 10px; } #complete{ + margin-top: 120px; + text-align: center; padding: 20px; } #complete p{ margin: 0 0 10px; font-size: 16px; } + #complete img{ + margin-top: 100px; + } @@ -375,7 +387,11 @@

- + + +
+
+ />

@@ -384,7 +400,7 @@

- + />

@@ -392,7 +408,7 @@

- Seperate multiple recipients with commas. + Seperate multiple email addresses with commas.

@@ -417,11 +433,14 @@

- Thanks for using Readability! + A link to this page has been sent to

- A link to this page has been sent to + Thanks for using Readability.

+
+ Readability +
-- cgit v1.2.3