summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-07-21 00:06:14 -0400
committerEvan Prodromou <evan@prodromou.name>2008-07-21 00:06:14 -0400
commita4edf5daef8cf4cc4c519781478b994272212f6f (patch)
treef7f83c55693b615d2fd6759fdbdcca1487fa0a6c
parent0c0ac46f434bfe9142f4f2c74e8e65d4cc08265a (diff)
use user field rather than re-building sms email over and over
darcs-hash:20080721040614-84dde-431def35d4e3c163df2b4f4e78bef7b3521be40a.gz
-rw-r--r--lib/mail.php13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/mail.php b/lib/mail.php
index 001376bea..3bcb0923d 100644
--- a/lib/mail.php
+++ b/lib/mail.php
@@ -175,19 +175,16 @@ function mail_broadcast_notice_sms($notice) {
function mail_send_notice($notice, $user) {
$profile = $user->getProfile();
$name = $profile->getBestName();
- $carrier = Sms_carrier::staticGet($user->carrier);
- $sms_email = $carrier->toEmailAddress($user->sms);
$to = $name . ' <' . $sms_email . '>';
$other = $notice->getProfile();
$headers = array();
$headers['From'] = $user->incomingemail;
- $headers['To'] = $name . ' <' . $sms_email . '>';
- $headers['Subject'] = sprintf(_('%s status on %s'),
- $other->getBestName(),
- common_exact_date($notice->created));
+ $headers['To'] = $name . ' <' . $user->smsemail . '>';
+ $headers['Subject'] = sprintf(_('%s status'),
+ $other->getBestName());
$body = $notice->content;
- mail_send($sms_email, $headers, $body);
+ mail_send($user->smsemail, $headers, $body);
}
function mail_confirm_sms($code, $nickname, $address) {
@@ -198,7 +195,7 @@ function mail_confirm_sms($code, $nickname, $address) {
$headers['To'] = $nickname . ' <' . $address . '>';
$headers['Subject'] = _('SMS confirmation');
- $body = "$nickname: confirm you own this number with this code:";
+ $body = "$nickname: confirm you own this phone number with this code:";
$body .= "\n\n";
$body .= $code;
$body .= "\n\n";