Skip to Content.
Sympa Menu

comanage-dev - [comanage-dev] r308 - in registry/trunk/app: Config Config/Schema Controller Lib View/CoEnrollmentFlows View/Emails/html View/Emails/text View/Layouts/Emails/html View/Layouts/Emails/text

Subject: COmanage Developers List

List archive

[comanage-dev] r308 - in registry/trunk/app: Config Config/Schema Controller Lib View/CoEnrollmentFlows View/Emails/html View/Emails/text View/Layouts/Emails/html View/Layouts/Emails/text


Chronological Thread 
  • From:
  • To:
  • Subject: [comanage-dev] r308 - in registry/trunk/app: Config Config/Schema Controller Lib View/CoEnrollmentFlows View/Emails/html View/Emails/text View/Layouts/Emails/html View/Layouts/Emails/text
  • Date: Wed, 11 Jul 2012 16:48:41 -0400

Author: marie
Date: 2012-07-11 16:48:41 -0400 (Wed, 11 Jul 2012)
New Revision: 308

Added:
registry/trunk/app/Config/email.php
registry/trunk/app/View/Emails/html/coinvite.ctp
registry/trunk/app/View/Emails/text/coinvite.ctp
registry/trunk/app/View/Layouts/Emails/html/basic.ctp
registry/trunk/app/View/Layouts/Emails/text/basic.ctp
Modified:
registry/trunk/app/Config/Schema/schema.xml
registry/trunk/app/Controller/CoInvitesController.php
registry/trunk/app/Lib/lang.php
registry/trunk/app/View/CoEnrollmentFlows/fields.inc
Log:
co352 - implement email delivery

Modified: registry/trunk/app/Config/Schema/schema.xml
===================================================================
--- registry/trunk/app/Config/Schema/schema.xml 2012-07-05 22:34:57 UTC (rev
307)
+++ registry/trunk/app/Config/Schema/schema.xml 2012-07-11 20:48:41 UTC (rev
308)
@@ -525,6 +525,7 @@
<field name="status" type="C" size="2" />
<field name="created" type="T" />
<field name="modified" type="T" />
+ <field name="notify_from" type="C" size="256" />

<index name="co_enrollment_flows_i1">
<col>co_id</col>

Modified: registry/trunk/app/Controller/CoInvitesController.php
===================================================================
--- registry/trunk/app/Controller/CoInvitesController.php 2012-07-05
22:34:57 UTC (rev 307)
+++ registry/trunk/app/Controller/CoInvitesController.php 2012-07-11
20:48:41 UTC (rev 308)
@@ -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";
@@ -386,10 +388,37 @@

$this->CoInvite->create($invite);

- if($this->CoInvite->save())
- {
- // XXX email the invitation, don't just render it
-
+ if($this->CoInvite->save()) {
+ // Set up and send the invitation via email
+ $email = new CakeEmail('default');
+ $viewVariables = $invite;
+ $viewVariables['Co'] = $this->cur_co['Co'];
+
+ try {
+ $email->template('coinvite', 'basic')
+ ->emailFormat('text')
+ ->to($orgp['EmailAddress'][0]['mail'])
+ ->viewVars($viewVariables)
+ ->subject(_txt('em.invite.subject',
array($this->cur_co['Co']['name'])));
+
+ // If this enrollment has a default email address set, use it,
otherwise leave in the default for the site.
+
if(isset($this->viewVars['cur_co']['CoEnrollmentFlow'][0]['notify_from']))
+
$email->from($this->viewVars['cur_co']['CoEnrollmentFlow'][0]['notify_from']);
+
+ // Send the email
+ $email->send();
+
+ // Notify user of success
+ $this->Session->setFlash(_txt('em.invite.ok',
+
array($orgp['EmailAddress'][0]['mail'])),
+ '',
+ array(),
+ 'success');
+
+ } catch(Exception $e) {
+ // Display error to user
+ $this->Session->setFlash($this->fieldsErrorToString($e), '',
array(), 'error');
+ }
// Set CO Person status to I
// XXX probably don't want to do this if status = A. May need a
new password reset status.

@@ -453,5 +482,11 @@
else
$this->Session->setFlash(_txt('er.cop.nf', array($cpid)), '',
array(), 'error');
}
+
+ // Redirect to My Population
+ $nextPage = array('controller' => 'co_people',
+ 'action' => 'index',
+ 'co' => $this->cur_co['Co']['id']);
+ $this->redirect($nextPage);
}
}

Modified: registry/trunk/app/Lib/lang.php
===================================================================
--- registry/trunk/app/Lib/lang.php 2012-07-05 22:34:57 UTC (rev 307)
+++ registry/trunk/app/Lib/lang.php 2012-07-11 20:48:41 UTC (rev 308)
@@ -94,6 +94,12 @@
'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.',
+ 'em.invite.ok' => 'Invitation has been emailed to %1$s',
+ 'em.invite.footer' => 'This email was sent using %1$s.',
+
// Enumerations, corresponding to enum.php
'en.admin' => array(AdministratorEnum::NoAdmin => 'None',
AdministratorEnum::CoAdmin => 'CO Admin',
@@ -311,6 +317,8 @@
'fd.ef.cf.cmp' => 'Platform Enrollment Configuration',
'fd.ef.coef' => 'Enable Attributes Via CO Enrollment Flow',
'fd.ef.coef.desc' => 'If enabled, allow organizational identity attributes
to be collected via forms during CO enrollment flows (these attributes will
be less authoritative than those obtained via LDAP or SAML)',
+ 'fd.ef.efn' => 'From Address for Notifications',
+ 'fd.ef.efn.desc' => 'Email address notifications will come from',
'fd.ef.epx' => 'Early Provisioning Executable',
'fd.ef.epx.desc' => '(Need for this TBD)',
'fd.ef.ldap' => 'Enable LDAP Attribute Retrieval',

Modified: registry/trunk/app/View/CoEnrollmentFlows/fields.inc
===================================================================
--- registry/trunk/app/View/CoEnrollmentFlows/fields.inc 2012-07-05
22:34:57 UTC (rev 307)
+++ registry/trunk/app/View/CoEnrollmentFlows/fields.inc 2012-07-11
20:48:41 UTC (rev 308)
@@ -171,6 +171,17 @@
:
Sanitize::html($co_enrollment_flows[0]['CoEnrollmentFlow']['notify_on_active']));
?>
</td>
</tr>
+ <tr class="line2">
+ <td>
+ <b><?php print _txt('fd.ef.efn'); ?></b><br />
+ <font class="desc"><?php print _txt('fd.ef.efn.desc'); ?></font>
+ </td>
+ <td>
+ <?php print ($e
+ ? $this->Form->input('notify_from')
+ :
Sanitize::html($co_enrollment_flows[0]['CoEnrollmentFlow']['notify_from']));
?>
+ </td>
+ </tr>
</tbody>
</table>
<?php



  • [comanage-dev] r308 - in registry/trunk/app: Config Config/Schema Controller Lib View/CoEnrollmentFlows View/Emails/html View/Emails/text View/Layouts/Emails/html View/Layouts/Emails/text, svnlog, 07/11/2012

Archive powered by MHonArc 2.6.16.

Top of Page