This repository has been archived by the owner on Jan 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added postal component for email notifications.
Added email notification for page posts.
- Loading branch information
1 parent
347c4dd
commit 0e898a5
Showing
7 changed files
with
218 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
/** | ||
* @version $Id$ | ||
* @package Appleseed.Components | ||
* @subpackage Postal | ||
* @copyright Copyright (C) 2004 - 2010 Michael Chisari. All rights reserved. | ||
* @link http://opensource.appleseedproject.org | ||
* @license GNU General Public License version 2.0 (See LICENSE.txt) | ||
*/ | ||
|
||
// Restrict direct access | ||
defined( 'APPLESEED' ) or die( 'Direct Access Denied' ); | ||
|
||
/** Postal Component Controller | ||
* | ||
* Postal Component Controller Class | ||
* | ||
* @package Appleseed.Components | ||
* @subpackage Postal | ||
*/ | ||
class cPostalPostalController extends cController { | ||
|
||
var $_Component = 'postal'; | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @access public | ||
*/ | ||
public function __construct ( ) { | ||
parent::__construct( ); | ||
} | ||
|
||
public function Display ( $pView = null, $pData = array ( ) ) { | ||
$pView = 'user'; | ||
return ( parent::Display ( $pView, $pData ) ); | ||
} | ||
|
||
} | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
; Enabled by default | ||
enabled="true" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<?php | ||
/** | ||
* @version $Id$ | ||
* @package Appleseed.Components | ||
* @subpackage Postal | ||
* @copyright Copyright (C) 2004 - 2010 Michael Chisari. All rights reserved. | ||
* @link http://opensource.appleseedproject.org | ||
* @license GNU General Public License version 2.0 (See LICENSE.txt) | ||
*/ | ||
|
||
// Restrict direct access | ||
defined( 'APPLESEED' ) or die( 'Direct Access Denied' ); | ||
|
||
/** Postal Component | ||
* | ||
* Postal Component Entry Class | ||
* | ||
* @package Appleseed.Components | ||
* @subpackage Postal | ||
*/ | ||
class cPostal extends cComponent { | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @access public | ||
*/ | ||
public function __construct ( ) { | ||
parent::__construct(); | ||
} | ||
|
||
public function Send ( $pData = array ( ) ) { | ||
|
||
include_once ( ASD_PATH . 'components/postal/controllers/postal.php' ); | ||
$Controller = new cPostalPostalController(); | ||
|
||
$Type = strtolower ( $pData['Type'] ); | ||
$SenderFullname = $pData['SenderFullname']; | ||
$SenderAccount = $pData['SenderAccount']; | ||
$RecipientEmail = $pData['RecipientEmail']; | ||
$MailSubject = $pData['MailSubject']; | ||
$Byline = $pData['Byline']; | ||
$Subject = $pData['Subject']; | ||
$Body = $pData['Body']; | ||
$LinkDescription = $pData['LinkDescription']; | ||
$Link = $pData['Link']; | ||
$Stamp = $this->GetSys ( 'Date' )->Format ( NOW(), true ); | ||
$data = array ( 'account' => $SenderAccount, 'source' => ASD_DOMAIN ); | ||
$AccountLink = $this->GetSys ( 'Event' )->Trigger ( 'Create', 'User', 'Link', $data ); | ||
|
||
$View = $Controller->GetView ( $Type ); | ||
|
||
list ( $username, $domain ) = explode ( '@', $SenderAccount ); | ||
$IconData = array ( 'username' => $username, 'domain' => $domain, 'width' => 64, 'height' => 64 ); | ||
$View->Find ( '.icon', 0 )->src = $this->GetSys ( 'Event' )->Trigger ( 'On', 'User', 'Icon', $IconData ); | ||
|
||
$View->Find ( '.fullname', 0 )->innertext = $SenderFullname; | ||
$View->Find ( '.fullname', 0 )->href = $AccountLink; | ||
$View->Find ( '.account', 0 )->innertext = $SenderAccount; | ||
$View->Find ( '.account', 0 )->href = $AccountLink; | ||
$View->Find ( '.byline-description', 0 )->innertext = $Byline; | ||
$View->Find ( '.subject', 0 )->innertext = $Subject; | ||
$View->Find ( '.body', 0 )->innertext = $Body; | ||
|
||
$View->Find ( '.stamp', 0 )->innertext = $Stamp; | ||
|
||
$View->Find ( '.link-description', 0 )->innertext = $LinkDescription; | ||
$View->Find ( '.link', 0 )->src = $Link; | ||
$View->Find ( '.link', 0 )->innertext = $Link; | ||
|
||
$from = "no-reply@" . ASD_DOMAIN; | ||
$fromName = "Appleseed"; | ||
$to = $RecipientEmail; | ||
$toName = $RecipientEmail; | ||
$subject = $MailSubject; | ||
$body = $View->Buffer(); | ||
|
||
$Mailer = $this->GetSys ( "Mailer" ); | ||
|
||
if ( !$Mailer->Send ( $from, $fromName, $to, $toName, $subject, $body ) ) { | ||
return ( false ); | ||
} | ||
|
||
return ( true ); | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<html> | ||
<head> | ||
<style> | ||
a { color:#406300; text-decoration:none; } | ||
a:hover { color:#406300; text-decoration:underline; } | ||
body { width:100%; float:left; background-color:#fafafa; font-family:Arial; font-size:12px; color:#000000; } | ||
#outline { margin:20px 0 20px 20px; float:left; width:100%; background-color:#ffffff; width:600px; border:1px solid #406300; } | ||
#outline { -webkit-box-shadow: rgba(0, 0, 0, .40) 3px 3px 6px; -moz-box-shadow: rgba(0, 0, 0, .40) 3px 3px 6px; -o-box-shadow: rgba(0, 0, 0, .40) 3px 3px 6px; box-shadow: rgba(0, 0, 0, .40) 3px 3px 6px; } | ||
#heading { padding:2px 6px 2px 12px; background-color:#80af1f; color:#ffffff; font-weight:bold; font-size:18px; } | ||
#main { } | ||
#header { float:left; margin:10px; padding-bottom:2px; border-bottom:1px solid #c0d895;} | ||
.icon-area { float:left; width:64px; } | ||
.icon-area .icon { width:64px; height:64px; } | ||
.byline { margin-left:10px; float:left; width:506px; color:#406300; } | ||
.byline .fullname { font-weight:bold; } | ||
.stamp { margin-left:10px; float:left; width:506px; color:#8a8a8a; font-size:11px; } | ||
.subject { margin-left:10px; float:left; width:506px; margin-top:25px;} | ||
.body { float:left; margin-left:84px; width:504px; min-height:140px; margin-bottom:10px; } | ||
#footer { float:left; margin:0 10px 15px 84px; background-color:#c0d895; border:1px solid #80af1f; width:494px; color:#000000; padding:4px 5px; } | ||
#footer { -webkit-box-shadow: rgba(0, 0, 0, .50) 0 0 6px; -moz-box-shadow: rgba(0, 0, 0, .50) 0 0 6px; -o-box-shadow: rgba(0, 0, 0, .50) 0 0 6px; box-shadow: rgba(0, 0, 0, .50) 0 0 6px; } | ||
.link-description { float:left; clear:both; } | ||
.link-area { float:left; clear:both; margin-top:5px; } | ||
</style> | ||
</head> | ||
|
||
<body style="float:left; width:100%; background-color:#fafafa; font-family:Arial; font-size:12px; color:#000000;"> | ||
<div id="outline" style="margin:20px 0 20px 20px; float:left; width:100%; background-color:#ffffff; width:600px; border:1px solid #406300; -webkit-box-shadow: rgba(0, 0, 0, .40) 3px 3px 6px; -moz-box-shadow: rgba(0, 0, 0, .40) 3px 3px 6px; -o-box-shadow: rgba(0, 0, 0, .40) 3px 3px 6px; box-shadow: rgba(0, 0, 0, .40) 3px 3px 6px;"> | ||
<div id="heading" style="padding:2px 6px 2px 12px; background-color:#80af1f; color:#ffffff; font-weight:bold; font-size:18px;">Appleseed</div> | ||
<div id="header" style="float:left; margin:10px; padding-bottom:2px; border-bottom:1px solid #c0d895;"> | ||
<span class="icon-area" style="float:left; width:64px;"> | ||
<img class="icon" style="width:64px; height:64px;" src="" /> | ||
</span> | ||
<span class="byline" style="margin-left:10px; float:left; width:506px; color:#406300;"> | ||
<a href="#" class="fullname" style="font-weight:bold; color:#406300; text-decoration:none;">#</a> (<a href="#" style="color:#406300; text-decoration:none;" class="account">#</a>) <span class="byline-description">#</span> | ||
</span> | ||
<span class="stamp" style="margin-left:10px; float:left; width:506px; color:#8a8a8a; font-size:11px;"> # </span> | ||
<span class="subject" style="margin-left:10px; float:left; width:506px; margin-top:25px;"> # </span> | ||
</div> | ||
<div id="main"> | ||
<span class="body" style="float:left; margin-left:84px; width:504px; min-height:140px; margin-bottom:10px;"> # </span> | ||
</div> | ||
<div id="footer" style="float:left; margin:0 10px 15px 84px; background-color:#c0d895; border:1px solid #80af1f; width:494px; color:#000000; padding:4px 5px; -webkit-box-shadow: rgba(0, 0, 0, .50) 0 0 6px; -moz-box-shadow: rgba(0, 0, 0, .50) 0 0 6px; -o-box-shadow: rgba(0, 0, 0, .50) 0 0 6px; box-shadow: rgba(0, 0, 0, .50) 0 0 6px;"> | ||
<span class="link-description" style="float:left; clear:both;">#</span> | ||
<span class="link-area" style="float:left; clear:both; margin-top:5px;"> | ||
<a href="#" style="color:#406300; text-decoration:none;" class="link"> # </a> | ||
</span> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |