Skip to content

Commit

Permalink
Fixed Invalid resource theme:// on CLI command test-email on Grav…
Browse files Browse the repository at this point in the history
… 1.6.21 and later versions [#128]
  • Loading branch information
mahagr committed Feb 27, 2020
1 parent bc5b138 commit 3ddc994
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v3.0.7
## mm/dd/2020

1. [](#bugfix)
* Fixed `Invalid resource theme://` on CLI command `test-email` on Grav 1.6.21 and later versions [#128](https://github.com/getgrav/grav-plugin-email/issues/128)

# v3.0.6
## 02/11/2020

Expand Down
5 changes: 5 additions & 0 deletions cli/ClearQueueFailuresCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ protected function configure()
*/
protected function serve()
{
// TODO: remove when requiring Grav 1.7+
if (method_exists($this, 'initializeGrav')) {
$this->initializeGrav();
}

$grav = Grav::instance();

$this->output->writeln('');
Expand Down
5 changes: 5 additions & 0 deletions cli/FlushQueueCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ protected function configure()
*/
protected function serve()
{
// TODO: remove when requiring Grav 1.7+
if (method_exists($this, 'initializeGrav')) {
$this->initializeGrav();
}

$grav = Grav::instance();

$this->output->writeln('');
Expand Down
9 changes: 5 additions & 4 deletions cli/TestEmailCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ protected function configure()
*/
protected function serve()
{
// TODO: remove when requiring Grav 1.7+
if (method_exists($this, 'initializeGrav')) {
$this->initializeThemes();
}

$grav = Grav::instance();

$this->output->writeln('');
Expand All @@ -69,8 +74,6 @@ protected function serve()

$this->output->writeln('');

require_once __DIR__ . '/../vendor/autoload.php';

$grav['Email'] = new Email();

$to = $this->input->getOption('to') ?: $grav['config']->get('plugins.email.to');
Expand All @@ -86,8 +89,6 @@ protected function serve()
$body = $grav['language']->translate(['PLUGIN_EMAIL.TEST_EMAIL_BODY', $configuration]);
}

// This is the old way....
// $sent = EmailUtils::sendEmail($subject, $body, $email_to);
$sent = EmailUtils::sendEmail(['subject'=>$subject, 'body'=>$body, 'to'=>$to]);

if ($sent) {
Expand Down

0 comments on commit 3ddc994

Please sign in to comment.