Skip to content
This repository has been archived by the owner on Apr 24, 2019. It is now read-only.

Commit

Permalink
Added configurable openfeedback "to" email address via settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Hall committed May 5, 2011
1 parent 029c3b3 commit 72e379a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
15 changes: 10 additions & 5 deletions of.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,15 @@
$message .= "Criticality: {$_POST['critical']}\n\n";
$message .= "Message: " . str_replace("\\n", "\n", $_POST['message']) . "\n\n";

Mail_Postmark::compose()
->addTo('[email protected]')
->subject($_POST['appname'] . ' ' . ucwords($_POST['type']))
->messagePlain($message)
->send();
// Login to Shine and visit your settings to set of_email...
$of_email = get_option('of_email', '');
if(strlen($of_email) > 0)
{
Mail_Postmark::compose()
->addTo($of_email)
->subject($_POST['appname'] . ' ' . ucwords($_POST['type']))
->messagePlain($message)
->send();
}

echo "ok";
14 changes: 10 additions & 4 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
if(isset($_POST['btnPayPal']))
{
set_option('paypal_url', $_POST['ipn_url']);
set_option('of_email', $_POST['of_email']);
redirect('settings.php');
}

$ipn_url = get_option('paypal_url', DEFAULT_IPN_URL)

$ipn_url = get_option('paypal_url', DEFAULT_IPN_URL);
$of_email = get_option('of_email', '');
?>
<?PHP include('inc/header.inc.php'); ?>

Expand All @@ -17,16 +19,20 @@
<div class="yui-b"><div class="yui-g">
<div class="block">
<div class="hd">
<h3>PayPal</h3>
<h3>Misc Settings</h3>
</div>
<div class="bd">
<form action="settings.php" method="post">
<p>
<label for="ipn_url">IPN URL</label> <input type="text" name="ipn_url" id="ipn_url" value="<?PHP echo $ipn_url;?>" class="text">
<label for="ipn_url">PayPal IPN URL</label> <input type="text" name="ipn_url" id="ipn_url" value="<?PHP echo $ipn_url;?>" class="text">
<span class="info">This is where PayPal will post back to when it receives an <a href="https://www.paypal.com/ipn">instant payment notification</a>.
<br>Default is: <a href="<?PHP echo DEFAULT_IPN_URL; ?>"><?PHP echo DEFAULT_IPN_URL; ?></a>
<br>Testing is: <a href="<?PHP echo SANDBOX_IPN_URL; ?>"><?PHP echo SANDBOX_IPN_URL; ?></a></span>
</p>
<p>
<label for="of_email">OpenFeedback Email</label> <input type="text" name="of_email" id="of_email" value="<?PHP echo $of_email;?>" class="text">
<span class="info">If you have <a href="https://github.com/tylerhall/OpenFeedback">OpenFeedback</a> enabled, this is where those reports will be sent.</span>
</p>
<p><input type="submit" name="btnPayPal" value="Save PayPal Settings" id="btnPayPal"></p>
</form>
</div>
Expand Down

0 comments on commit 72e379a

Please sign in to comment.