Skip to content
This repository has been archived by the owner on Jun 4, 2018. It is now read-only.

Commit

Permalink
0.4.2 bugfix release
Browse files Browse the repository at this point in the history
- Fix send() method missing return which could cause problems sometimes, fixes #6
- Add transliterator check for some systems where the translit ID might not exist
  • Loading branch information
plauclair committed Apr 29, 2016
1 parent 320c011 commit d024faa
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions WireMailMailgun.module
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class WireMailMailgun extends WireMail implements Module, ConfigurableModule
{
return array(
'title' => 'WireMail Mailgun',
'version' => '0.4.1',
'version' => '0.4.2',
'summary' => "Mailgun for ProcessWire",
'href' => 'https://github.com/plauclair/WireMailMailgun',
'author' => 'plauclair',
Expand Down Expand Up @@ -178,7 +178,7 @@ class WireMailMailgun extends WireMail implements Module, ConfigurableModule
*/
public function send()
{
$this->___send();
return $this->___send();
}

/**
Expand Down Expand Up @@ -593,9 +593,11 @@ class WireMailMailgun extends WireMail implements Module, ConfigurableModule
*/
public function addTag($tag)
{
if (function_exists('transliterator_transliterate')) {
// check if transliterator_transliterate exists and translit ID is valid on current system
$transId = 'Any-Latin; Latin-ASCII; [\u0080-\u7fff] remove';
if (function_exists('transliterator_transliterate') and ($transliterator = \Transliterator::create($transId))) {
// convert to ASCII
$tag = transliterator_transliterate('Any-Latin; Latin-ASCII; [\u0080-\u7fff] remove', $tag);
$transString = $transliterator->transliterate($tag);
} else {
// basic fallback to iconv... might be unreliable but kind of works
$tag = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $tag);
Expand Down

0 comments on commit d024faa

Please sign in to comment.