Skip to content

Commit

Permalink
Add a script to send a test email
Browse files Browse the repository at this point in the history
  • Loading branch information
mezrin committed May 15, 2014
1 parent fef95b9 commit 88eaf66
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
19 changes: 19 additions & 0 deletions scripts/test_email.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

// Change to working directory
chdir(dirname(__FILE__));

// Include all settings and classes
require_once('shared.inc.php');

// Send email
$aMailData = array(
'email' => $setting->getValue('system_error_email'),
'subject' => 'Test email from mining pool',
'coinname' => $config['gettingstarted']['coinname'],
'stratumurl' => $config['gettingstarted']['stratumurl'],
'stratumport' => $config['gettingstarted']['stratumport']
);

if (!$mail->sendMail('notifications/test_email', $aMailData))
echo "Failed to send test email" . PHP_EOL;
6 changes: 6 additions & 0 deletions templates/mail/notifications/test_email.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{include file="../global/header.tpl"}
<h1>Test email</h1>
<p>If you see this email - your email protocol is configured correctly</p>
<p>Coin name: {$DATA.coinname}</p>
<p>Stratum: {$DATA.stratumurl}:{$DATA.stratumport}</p>
{include file="../global/footer.tpl"}

0 comments on commit 88eaf66

Please sign in to comment.