Index: Controller/CoInvitesController.php
===================================================================
--- Controller/CoInvitesController.php	(revision 300)
+++ Controller/CoInvitesController.php	(working copy)
@@ -22,6 +22,8 @@
  * @version       $Id$
  */
 
+App::uses('CakeEmail', 'Network/Email');
+
 class CoInvitesController extends AppController {
   // We don't extend StandardController because there's so much unique stuff going on here
   public $name = "CoInvites";
@@ -388,8 +390,17 @@
         
         if($this->CoInvite->save())
         {
-          // XXX email the invitation, don't just render it
-  
+          // Set up and send the invitation via email
+          $email = new CakeEmail('default');
+          $viewVariables = $invite;
+          $viewVariables['Co'] = $this->cur_co['Co'];
+          $email->template('coinvite', 'basic')
+                ->emailFormat('html')
+                ->to($orgp['EmailAddress'][0]['mail'])
+                ->viewVars($viewVariables)
+                ->subject(_txt('em.invite.subject', array($this->cur_co['Co']['name'])))
+                ->send();
+
           // Set CO Person status to I
           // XXX probably don't want to do this if status = A.  May need a new password reset status.
   
Index: Config/email.php
===================================================================
--- Config/email.php	(revision 0)
+++ Config/email.php	(revision 0)
@@ -0,0 +1,97 @@
+<?php
+/**
+ * This is email configuration file.
+ *
+ * Use it to configure email transports of Cake.
+ *
+ * PHP 5
+ *
+ * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
+ * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
+ *
+ * Licensed under The MIT License
+ * Redistributions of files must retain the above copyright notice.
+ *
+ * @copyright     Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
+ * @link          http://cakephp.org CakePHP(tm) Project
+ * @package       app.Config
+ * @since         CakePHP(tm) v 2.0.0
+ * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
+ */
+/**
+ * In this file you set up your send email details.
+ *
+ * @package       cake.config
+ */
+/**
+ * Email configuration class.
+ * You can specify multiple configurations for production, development and testing.
+ *
+ * transport => The name of a supported transport; valid options are as follows:
+ *		Mail 		- Send using PHP mail function
+ *		Smtp		- Send using SMTP
+ *		Debug		- Do not send the email, just return the result
+ *
+ * You can add custom transports (or override existing transports) by adding the
+ * appropriate file to app/Network/Email.  Transports should be named 'YourTransport.php',
+ * where 'Your' is the name of the transport.
+ *
+ * from =>
+ * The origin email. See CakeEmail::from() about the valid values
+ *
+ */
+class EmailConfig {
+
+	public $default = array(
+		'transport' => 'Mail',
+		'from' => 'undefined@yourdomain.org',
+		//'charset' => 'utf-8',
+		//'headerCharset' => 'utf-8',
+	);
+
+	public $smtp = array(
+		'transport' => 'Smtp',
+		'from' => array('site@localhost' => 'My Site'),
+		'host' => 'localhost',
+		'port' => 25,
+		'timeout' => 30,
+		'username' => 'user',
+		'password' => 'secret',
+		'client' => null,
+		'log' => false
+		//'charset' => 'utf-8',
+		//'headerCharset' => 'utf-8',
+	);
+
+	public $fast = array(
+		'from' => 'you@localhost',
+		'sender' => null,
+		'to' => null,
+		'cc' => null,
+		'bcc' => null,
+		'replyTo' => null,
+		'readReceipt' => null,
+		'returnPath' => null,
+		'messageId' => true,
+		'subject' => null,
+		'message' => null,
+		'headers' => null,
+		'viewRender' => null,
+		'template' => false,
+		'layout' => false,
+		'viewVars' => null,
+		'attachments' => null,
+		'emailFormat' => null,
+		'transport' => 'Smtp',
+		'host' => 'localhost',
+		'port' => 25,
+		'timeout' => 30,
+		'username' => 'user',
+		'password' => 'secret',
+		'client' => null,
+		'log' => true,
+		//'charset' => 'utf-8',
+		//'headerCharset' => 'utf-8',
+	);
+
+}
Index: Lib/lang.php
===================================================================
--- Lib/lang.php	(revision 300)
+++ Lib/lang.php	(working copy)
@@ -92,6 +92,10 @@
   'ct.telephone_numbers.1' =>   'Telephone Number',
   'ct.telephone_numbers.pl' =>  'Telephone Numbers',
 
+  // Email Messages
+  'em.invite.subject'        => 'Invitation to join %1$s',
+  'em.invite.body'           => 'You have been invited to join %1$s.  Please click the link below to accept or decline.',
+
   // Enumerations, corresponding to enum.php
   'en.admin' =>       array(AdministratorEnum::NoAdmin => 'None',
                             AdministratorEnum::CoAdmin => 'CO Admin',
Index: View/Layouts/Emails/html/basic.ctp
===================================================================
--- View/Layouts/Emails/html/basic.ctp	(revision 0)
+++ View/Layouts/Emails/html/basic.ctp	(revision 0)
@@ -0,0 +1,31 @@
+<?php
+/**
+ * COmanage Registry basic email layout
+ *
+ * Copyright (C) 2010-12 University Corporation for Advanced Internet Development, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software distributed under
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * @copyright     Copyright (C) 2010-12 University Corporation for Advanced Internet Development, Inc.
+ * @link          http://www.internet2.edu/comanage COmanage Project
+ * @package       registry
+ * @since         COmanage Registry v0.1
+ * @license       Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
+ * @version       $Id$
+ */
+
+
+  echo $content_for_layout;
+?>
+<br>
+<br>
+
+This email was sent using CoManage Registry.
Index: View/Layouts/Emails/text/basic.ctp
===================================================================
--- View/Layouts/Emails/text/basic.ctp	(revision 0)
+++ View/Layouts/Emails/text/basic.ctp	(revision 0)
@@ -0,0 +1,29 @@
+<?php
+/**
+ * COmanage Registry basic email layout
+ *
+ * Copyright (C) 2010-12 University Corporation for Advanced Internet Development, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software distributed under
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * @copyright     Copyright (C) 2010-12 University Corporation for Advanced Internet Development, Inc.
+ * @link          http://www.internet2.edu/comanage COmanage Project
+ * @package       registry
+ * @since         COmanage Registry v0.1
+ * @license       Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
+ * @version       $Id$
+ */
+
+
+  print $content_for_layout;
+?>
+
+This email was sent using CoManage Registry.
Index: View/CoInvites/send.ctp
===================================================================
--- View/CoInvites/send.ctp	(revision 300)
+++ View/CoInvites/send.ctp	(working copy)
@@ -28,12 +28,11 @@
 ?>
 
 <p>
-Email would be sent to <b><?php echo $invite['CoInvite']['mail']; ?></b> with the URL
+Email has been sent to <b><?php echo $invite['CoInvite']['mail']; ?></b>
 <br />
 <br />
-<?php 
+<?php
   $u = $this->Html->url(array('controller' => 'co_invites', 'action' => 'reply', $invite['CoInvite']['invitation']), true);
-  
-  echo $this->Html->link($u, $u);
+  debug('DEBUG: This is the URL sent in the email. '. $u);
 ?>
 </p>
Index: View/Emails/html/coinvite.ctp
===================================================================
--- View/Emails/html/coinvite.ctp	(revision 0)
+++ View/Emails/html/coinvite.ctp	(revision 0)
@@ -0,0 +1,32 @@
+<?php
+/**
+ * COmanage Registry CO Invite HTML Email Template
+ *
+ * Copyright (C) 2011-12 University Corporation for Advanced Internet Development, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software distributed under
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * @copyright     Copyright (C) 2011-12 University Corporation for Advanced Internet Development, Inc.
+ * @link          http://www.internet2.edu/comanage COmanage Project
+ * @package       registry
+ * @since         COmanage Registry v0.1
+ * @license       Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
+ * @version       $Id$
+ */
+
+  print _txt('em.invite.body', array($this->viewVars['Co']['name']));
+?>
+<br><br>
+<?php
+  $u = $this->Html->url(array('controller' => 'co_invites', 'action' => 'reply', $this->viewVars['CoInvite']['invitation']), true);
+  print $u;
+?>
+
Index: View/Emails/text/coinvite.ctp
===================================================================
--- View/Emails/text/coinvite.ctp	(revision 0)
+++ View/Emails/text/coinvite.ctp	(revision 0)
@@ -0,0 +1,32 @@
+<?php
+/**
+ * COmanage Registry CO Invite text Email Template
+ *
+ * Copyright (C) 2011-12 University Corporation for Advanced Internet Development, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software distributed under
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * @copyright     Copyright (C) 2011-12 University Corporation for Advanced Internet Development, Inc.
+ * @link          http://www.internet2.edu/comanage COmanage Project
+ * @package       registry
+ * @since         COmanage Registry v0.1
+ * @license       Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
+ * @version       $Id$
+ */
+
+  print _txt('em.invite.body', array($this->viewVars['Co']['name']));
+?>
+
+<?php
+  $u = $this->Html->url(array('controller' => 'co_invites', 'action' => 'reply', $this->viewVars['CoInvite']['invitation']), true);
+  print $u;
+?>
+
