-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integration Tests: Add emailtest.php template for owncloud 8.1
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 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
18 changes: 18 additions & 0 deletions
18
test/cookbooks/owncloud_test/templates/default/emailtest-8.1.php.erb
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,18 @@ | ||
<?php | ||
|
||
try { | ||
require_once 'lib/base.php'; | ||
|
||
$defaults = new \OC_Defaults(); | ||
$mailer = \OC::$server->getMailer(); | ||
$message = $mailer->createMessage(); | ||
$message->setTo(['root@localhost.localdomain' => 'root']); | ||
$message->setSubject('Email Sending Test'); | ||
$message->setPlainBody('Email Sending Test'); | ||
$message->setFrom([ | ||
\OCP\Util::getDefaultEmailAddress('kitchen-test') => $defaults->getName() | ||
]); | ||
$mailer->send($message); | ||
} catch (Exception $ex) { | ||
OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR); | ||
} |