Skip to content

Instantly share code, notes, and snippets.

@dkobia
Last active December 28, 2015 03:38
Show Gist options
  • Save dkobia/7436034 to your computer and use it in GitHub Desktop.
Save dkobia/7436034 to your computer and use it in GitHub Desktop.
<?php
public function action_email()
{
$this->template = '';
$this->auto_render = FALSE;
// Use App's Email Setup to Send Mail
$driver = PingApp_Settings::get('email_outgoing_type');
$options = array(
'hostname' => PingApp_Settings::get('email_outgoing_host'),
'port' => PingApp_Settings::get('email_outgoing_port'),
'encryption' => (PingApp_Settings::get('email_outgoing_security') != 'none')
? PingApp_Settings::get('email_outgoing_security') : '',
'username' => PingApp_Settings::get('email_outgoing_username'),
'password' => PingApp_Settings::get('email_outgoing_password')
);
$config = Kohana::$config->load('email');
$config->set('driver', $driver);
$config->set('options', $options);
$body = View::factory('email/layout');
$email = Email::factory('Test Email', $body->render(), 'text/html')
->to('[email protected]')
->from('[email protected]', 'Seth')
->send();
echo $body;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment