From bf0be3ddb7226f428a3cc00a87c5a64f2113c00b Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 20 Jun 2008 01:15:36 -0400 Subject: confirm email addresses darcs-hash:20080620051536-5ed1f-231e427832dd20c861eb7a6dc1171315e90f455b.gz --- lib/mail.php | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'lib/mail.php') diff --git a/lib/mail.php b/lib/mail.php index 25253fd81..23fd24b25 100644 --- a/lib/mail.php +++ b/lib/mail.php @@ -54,4 +54,30 @@ function mail_notify_from() { return $config['site']['name'] . ' '; } } - \ No newline at end of file + +# For confirming an email address + +function mail_confirm_address($code, $nickname, $address) { + $recipients = $address; + $headers['From'] = mail_notify_from(); + $headers['To'] = $nickname . ' <' . $address . '>'; + $headers['Subject'] = _t('Email address confirmation'); + + $body = "Hey, $nickname."; + $body .= "\n\n"; + $body .= 'Someone just entered this email address on ' . common_config('site', 'name') . '.'; + $body .= "\n\n"; + $body .= 'If it was you, and you want to confirm your entry, use the URL below:'; + $body .= "\n\n"; + $body .= "\t".common_local_url('confirmemail', + array('code' => $code)); + $body .= "\n\n"; + $body .= 'If not, just ignore this message.'; + $body .= "\n\n"; + $body .= 'Thanks for your time, '; + $body .= "\n"; + $body .= common_config('site', 'name'); + $body .= "\n"; + + mail_send($recipients, $headers, $body); +} -- cgit v1.2.3-54-g00ecf