-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
195 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
src/app/code/community/Mageone/Qps app/code/community/Mageone/Qps | ||
src/app/locale/de_DE/Mageone_Qps.csv app/locale/de_DE/Mageone_Qps.csv | ||
src/app/locale/en_US/Mageone_Qps.csv app/locale/en_US/Mageone_Qps.csv | ||
src/app/locale/en_US/template/email/qps_ruleupdate.html app/locale/en_US/template/email/qps_ruleupdate.html | ||
src/app/locale/de_DE/template/email/qps_ruleupdate.html app/locale/de_DE/template/email/qps_ruleupdate.html | ||
|
||
src/app/etc/modules/Mageone_Qps.xml app/etc/modules/Mageone_Qps.xml |
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,43 @@ | ||
<?php | ||
|
||
declare(strict_types = 1); | ||
|
||
class Mageone_Qps_Model_EmailService | ||
{ | ||
|
||
public function sendNotificationEmail(Mageone_Qps_Helper_Data $helper): void | ||
{ | ||
if ($helper->isNotificationEnabled() === false) { | ||
return; | ||
} | ||
|
||
if ($this->isEmailValid($helper->getNotificationEmail()) === false) { | ||
Mage::log('QPS notification email address seems to be invalid. Please check your configuration!'); | ||
|
||
return; | ||
} | ||
|
||
$variables = []; | ||
if (!$helper->isRuleAutoEnable()) { | ||
$variables['notautoenable'] = 'true'; | ||
} | ||
|
||
$mail = Mage::getModel('core/email_template'); | ||
try { | ||
$mail->sendTransactional( | ||
'mageone_qps_ruleupdate', | ||
'general', | ||
$helper->getNotificationEmail(), | ||
'Mage One QPS', | ||
$variables | ||
); | ||
} catch (Mage_Core_Exception $e) { | ||
Mage::log('QPS notification email could not be send.'); | ||
} | ||
} | ||
|
||
private function isEmailValid($emailAddress): bool | ||
{ | ||
return filter_var($emailAddress, FILTER_VALIDATE_EMAIL) !== false; | ||
} | ||
} |
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
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,18 @@ | ||
<!--@subject Neue QPS Regeln aktualisiert! @--> | ||
<!--@vars @--> | ||
<!--@styles @--> | ||
|
||
{{template config_path="design/email/header"}} | ||
{{inlinecss file="email-inline.css"}} | ||
|
||
<table cellpadding="0" cellspacing="0" border="0"> | ||
<tr> | ||
<td class="action-content"> | ||
<h1>Neue QPS Regeln in {{var store.getFrontendName()}}.</h1> | ||
<p>Das Regelset für QPS wurde soeben aktualisiert.</p> | ||
{{if notautoenable}}<p>Bitte prüfen und aktivieren Sie die neuen Regeln.</p>{{/if}} | ||
</td> | ||
</tr> | ||
</table> | ||
|
||
{{template config_path="design/email/footer"}} |
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,18 @@ | ||
<!--@subject New QPS rule were synced! @--> | ||
<!--@vars @--> | ||
<!--@styles @--> | ||
|
||
{{template config_path="design/email/header"}} | ||
{{inlinecss file="email-inline.css"}} | ||
|
||
<table cellpadding="0" cellspacing="0" border="0"> | ||
<tr> | ||
<td class="action-content"> | ||
<h1>New QPS rules in {{var store.getFrontendName()}}.</h1> | ||
<p>We just updated the QPS rule set.</p> | ||
{{if notautoenable}}<p>Please review the rules and enable them accordingly.</p>{{/if}} | ||
</td> | ||
</tr> | ||
</table> | ||
|
||
{{template config_path="design/email/footer"}} |