Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion appengine/standard/mailgun/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
$app = new Application();

$app->get('/', function () use ($app) {
if ($app['mailgun.domain'] == 'MAILGUN_DOMAIN_NAME') {
if ($app['mailgun.domain'] == 'MAILGUN_DOMAIN') {
return 'set your mailgun domain and API key in <code>index.php</code>';
}

Expand Down
2 changes: 1 addition & 1 deletion appengine/standard/mailgun/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
$app = require __DIR__ . '/app.php';

// set your Mailgun domain name and API key
$app['mailgun.domain'] = 'MAILGUN_DOMAIN_NAME';
$app['mailgun.domain'] = 'MAILGUN_DOMAIN';
$app['mailgun.api_key'] = 'MAILGUN_APIKEY';

// Run the app!
Expand Down
16 changes: 12 additions & 4 deletions appengine/standard/mailgun/test/DeployAppEngineFlexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,29 @@ class DeployAppEngineFlexTest extends \PHPUnit_Framework_TestCase
{
use AppEngineDeploymentTrait;

public function beforeDeploy()
public static function beforeDeploy()
{
// set your Mailgun domain name and API key
$mailgunDomain = getenv('MAILGUN_DOMAIN');
$mailgunApiKey = getenv('MAILGUN_APIKEY');

if (empty($mailgunDomain) || empty($mailgunApiKey)) {
self::markTestSkipped('set the MAILGUN_DOMAIN and MAILGUN_APIKEY environment variables');
}

$tmpDir = FileUtil::cloneDirectoryIntoTmp(__DIR__ . '/..');
FileUtil::copyDir(__DIR__ . '/../../../flexible/mailgun', $tmpDir);
self::$gcloudWrapper->setDir($tmpDir);
chdir($tmpDir);
$indexPhp = file_get_contents('index.php');
$indexPhp = str_replace(
'MAILGUN_DOMAIN_NAME',
getenv('MAILGUN_DOMAIN_NAME'),
'MAILGUN_DOMAIN',
$mailgunDomain,
$indexPhp
);
$indexPhp = str_replace(
'MAILGUN_APIKEY',
getenv('MAILGUN_APIKEY'),
$mailgunApiKey,
$indexPhp
);
file_put_contents('index.php', $indexPhp);
Expand Down