-
-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented the Core Email API, created by Huib Keemink and Michael E…
…ichelsdoerfer.
- Loading branch information
1 parent
03a9a1f
commit c28a238
Showing
13 changed files
with
1,591 additions
and
83 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
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 | ||
|
||
/** | ||
* @package toolkit | ||
*/ | ||
|
||
/** | ||
* The Exception to be thrown by the Email class. | ||
*/ | ||
class EmailException extends Exception{ | ||
} | ||
|
||
include_once(TOOLKIT . '/class.emailgatewaymanager.php'); | ||
|
||
/** | ||
* The Email class is a factory class to make it possible to send emails using different gateways. | ||
*/ | ||
Abstract class Email{ | ||
|
||
private $gateway; | ||
|
||
/** | ||
* Returns the EmailGateway to send emails with. | ||
* Calling this function multiple times will return unique objects. | ||
* | ||
* @param string $gateway | ||
* The name of the gateway to use. Please only supply if specific gateway functions are beeing used. | ||
* If the gateway is not found, it will throw an EmailException | ||
* @return EmailGateway | ||
*/ | ||
function create($gateway = null){ | ||
$email_gateway_manager = new EmailGatewayManager($this); | ||
if($gateway){ | ||
return $email_gateway_manager->create($gateway); | ||
} | ||
else{ | ||
return $email_gateway_manager->create($email_gateway_manager->getDefaultGateway()); | ||
} | ||
} | ||
} |
Oops, something went wrong.