Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issue #18436: RC API - Inviting members with invalid language s…
…ends them an email but they're not marked as invited (#3571)
- Loading branch information
Showing
5 changed files
with
146 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
class DummyMailer extends PluginBase | ||
{ | ||
protected static $description = 'Marks all emails as sent'; | ||
protected static $name = 'DummyMailer'; | ||
|
||
private $errorToReturn = null; | ||
|
||
/** @inheritdoc, this plugin didn't have any public method */ | ||
public $allowedPublicMethods = array(); | ||
|
||
public function init() | ||
{ | ||
$this->subscribe('beforeEmail', 'beforeEmail'); | ||
$this->subscribe('beforeSurveyEmail', 'beforeEmail'); | ||
$this->subscribe('beforeTokenEmail', 'beforeEmail'); | ||
} | ||
|
||
public function beforeEmail() | ||
{ | ||
$event = $this->getEvent(); | ||
$event->set('send', false); | ||
$event->set('error', $this->errorToReturn); | ||
} | ||
|
||
public function setError($error) | ||
{ | ||
$this->errorToReturn = $error; | ||
} | ||
|
||
public function reset() | ||
{ | ||
$this->errorToReturn = null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters