Skip to content

Commit

Permalink
RadicalMart Message: Email v1.1.1 (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
Septdir authored Apr 19, 2022
1 parent 25aa2e8 commit f6d6a87
Show file tree
Hide file tree
Showing 10 changed files with 90 additions and 21 deletions.
7 changes: 2 additions & 5 deletions email.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
* @package RadicalMart Package
* @subpackage plg_radicalmart_message_email
* @version 1.1.0
* @version 1.1.1
* @author Delo Design - delo-design.ru
* @copyright Copyright (c) 2021 Delo Design. All rights reserved.
* @license GNU/GPL license: https://www.gnu.org/copyleft/gpl.html
Expand Down Expand Up @@ -185,10 +185,7 @@ protected function sendEmail($subject, $recipient, $body)
$mailer->isHtml(true);
$mailer->Encoding = 'base64';
$mailer->addRecipient($recipient);
$mailer->addReplyTo(array(
$config->get('replyto'),
$config->get('replytoname')
));
$mailer->addReplyTo($config->get('replyto'), $config->get('replytoname'));
$mailer->setBody($body);

return $mailer->Send();
Expand Down
4 changes: 2 additions & 2 deletions email.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<extension version="3.9" type="plugin" group="radicalmart_message" method="upgrade">
<name>PLG_RADICALMART_MESSAGE_EMAIL</name>
<author>Delo Design</author>
<creationDate>March 2022</creationDate>
<creationDate>April 2022</creationDate>
<copyright>Copyright © 2021 Delo Design. All rights reserved.</copyright>
<license>https://www.gnu.org/copyleft/gpl.html GNU/GPL</license>
<authorEmail>boss@delo-design.ru</authorEmail>
<authorUrl>https://delo-design.ru</authorUrl>
<version>1.1.0</version>
<version>1.1.1</version>
<description>PLG_RADICALMART_MESSAGE_EMAIL_DESCRIPTION</description>
<scriptfile>script.php</scriptfile>
<languages folder="language">
Expand Down
2 changes: 1 addition & 1 deletion language/en-GB/en-GB.plg_radicalmart_message_email.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; @package RadicalMart Package
; @subpackage plg_radicalmart_message_email
; @version 1.1.0
; @version 1.1.1
; @author Delo Design - delo-design.ru
; @copyright Copyright (c) 2021 Delo Design. All rights reserved.
; @license GNU/GPL license: https://www.gnu.org/copyleft/gpl.html
Expand Down
2 changes: 1 addition & 1 deletion language/en-GB/en-GB.plg_radicalmart_message_email.sys.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; @package RadicalMart Package
; @subpackage plg_radicalmart_message_email
; @version 1.1.0
; @version 1.1.1
; @author Delo Design - delo-design.ru
; @copyright Copyright (c) 2021 Delo Design. All rights reserved.
; @license GNU/GPL license: https://www.gnu.org/copyleft/gpl.html
Expand Down
2 changes: 1 addition & 1 deletion language/ru-RU/ru-RU.plg_radicalmart_message_email.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; @package RadicalMart Package
; @subpackage plg_radicalmart_message_email
; @version 1.1.0
; @version 1.1.1
; @author Delo Design - delo-design.ru
; @copyright Copyright (c) 2021 Delo Design. All rights reserved.
; @license GNU/GPL license: https://www.gnu.org/copyleft/gpl.html
Expand Down
2 changes: 1 addition & 1 deletion language/ru-RU/ru-RU.plg_radicalmart_message_email.sys.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; @package RadicalMart Package
; @subpackage plg_radicalmart_message_email
; @version 1.1.0
; @version 1.1.1
; @author Delo Design - delo-design.ru
; @copyright Copyright (c) 2021 Delo Design. All rights reserved.
; @license GNU/GPL license: https://www.gnu.org/copyleft/gpl.html
Expand Down
44 changes: 40 additions & 4 deletions layouts/order/create.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
* @package RadicalMart Package
* @subpackage plg_radicalmart_message_email
* @version 1.1.0
* @version 1.1.1
* @author Delo Design - delo-design.ru
* @copyright Copyright (c) 2021 Delo Design. All rights reserved.
* @license GNU/GPL license: https://www.gnu.org/copyleft/gpl.html
Expand Down Expand Up @@ -33,8 +33,9 @@
*/


$link = Uri::getInstance()->toString(array('scheme', 'host', 'port'));
$link .= ($recipient === 'admin') ? '/administrator/index.php?option=' . $component . '&task=order.edit&id='
$root = Uri::getInstance()->toString(array('scheme', 'host', 'port'));
$link = $root;
$link .= ($recipient === 'admin') ? '/administrator/index.php?option=' . $component . '&task=order.edit&id='
. $order->id : $order->link;
?>
<h1>
Expand Down Expand Up @@ -111,7 +112,7 @@
<tr>
<td style="<?php echo $style; ?>">
<?php if ($product->link && $links) : ?>
<a href="<?php echo $product->link; ?>" style="word-wrap:break-word;"
<a href="<?php echo $root . $product->link; ?>" style="word-wrap:break-word;"
class="uk-link-reset"><?php echo $product->title; ?></a>
<?php else: ?>
<?php echo $product->title; ?>
Expand Down Expand Up @@ -146,6 +147,41 @@ class="uk-link-reset"><?php echo $product->title; ?></a>
</td>
</tr>
<?php endforeach; ?>
<?php if (!empty($order->shipping) && !empty($order->shipping->order) && !empty($order->shipping->order->price)):
$style = 'padding: 8px; line-height: 18px; text-align: left; vertical-align: top;border-top: 1px solid #ddd;';
if ($i % 2) $style .= 'background-color: #f9f9f9;';
$i++;
?>
<tr>
<td style="<?php echo $style; ?>">
<?php echo (!empty($order->shipping->order->title)) ?
$order->shipping->order->title : $order->shipping->title; ?>
</td>
<td style="<?php echo $style; ?> text-align: right;border-left: 1px solid #ddd;">
<?php if (!empty($order->shipping->order->price['discount_enable'])): ?>
<div style="font-size: 12px; color: #ccc">
<s><?php echo $order->shipping->order->price['base_seo']; ?></s>
<?php echo ' ( - ' . $order->shipping->order->price['discount_seo'] . ')'; ?>
</div>
<?php endif; ?>
<div>
<?php echo str_replace(' ', '&nbsp;', $order->shipping->order->price['final_seo']); ?>
</div>
</td>
<td style="<?php echo $style; ?> text-align: center;border-left: 1px solid #ddd;">1</td>
<td style="<?php echo $style; ?> text-align: right;border-left: 1px solid #ddd;">
<?php if (!empty($order->shipping->order->price['discount_enable'])): ?>
<div style="font-size: 12px; color: #ccc">
<s><?php echo $order->shipping->order->price['base_seo']; ?></s>
<?php echo ' ( - ' . $order->shipping->order->price['discount_seo'] . ')'; ?>
</div>
<?php endif; ?>
<div>
<?php echo str_replace(' ', '&nbsp;', $order->shipping->order->price['final_seo']); ?>
</div>
</td>
</tr>
<?php endif; ?>
</tbody>
<tfoot>
<tr>
Expand Down
44 changes: 40 additions & 4 deletions layouts/order/status.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
* @package RadicalMart Package
* @subpackage plg_radicalmart_message_email
* @version 1.1.0
* @version 1.1.1
* @author Delo Design - delo-design.ru
* @copyright Copyright (c) 2021 Delo Design. All rights reserved.
* @license GNU/GPL license: https://www.gnu.org/copyleft/gpl.html
Expand Down Expand Up @@ -32,8 +32,9 @@
*
*/

$link = Uri::getInstance()->toString(array('scheme', 'host', 'port'));
$link .= ($recipient === 'admin') ? '/administrator/index.php?option=' . $component . '&task=order.edit&id='
$root = Uri::getInstance()->toString(array('scheme', 'host', 'port'));
$link = $root;
$link .= ($recipient === 'admin') ? '/administrator/index.php?option=' . $component . '&task=order.edit&id='
. $order->id : $order->link;
?>
<h1>
Expand Down Expand Up @@ -110,7 +111,7 @@
<tr>
<td style="<?php echo $style; ?>">
<?php if ($product->link && $links) : ?>
<a href="<?php echo $product->link; ?>" style="word-wrap:break-word;"
<a href="<?php echo $root . $product->link; ?>" style="word-wrap:break-word;"
class="uk-link-reset"><?php echo $product->title; ?></a>
<?php else: ?>
<?php echo $product->title; ?>
Expand Down Expand Up @@ -145,6 +146,41 @@ class="uk-link-reset"><?php echo $product->title; ?></a>
</td>
</tr>
<?php endforeach; ?>
<?php if (!empty($order->shipping) && !empty($order->shipping->order) && !empty($order->shipping->order->price)):
$style = 'padding: 8px; line-height: 18px; text-align: left; vertical-align: top;border-top: 1px solid #ddd;';
if ($i % 2) $style .= 'background-color: #f9f9f9;';
$i++;
?>
<tr>
<td style="<?php echo $style; ?>">
<?php echo (!empty($order->shipping->order->title)) ?
$order->shipping->order->title : $order->shipping->title; ?>
</td>
<td style="<?php echo $style; ?> text-align: right;border-left: 1px solid #ddd;">
<?php if (!empty($order->shipping->order->price['discount_enable'])): ?>
<div style="font-size: 12px; color: #ccc">
<s><?php echo $order->shipping->order->price['base_seo']; ?></s>
<?php echo ' ( - ' . $order->shipping->order->price['discount_seo'] . ')'; ?>
</div>
<?php endif; ?>
<div>
<?php echo str_replace(' ', '&nbsp;', $order->shipping->order->price['final_seo']); ?>
</div>
</td>
<td style="<?php echo $style; ?> text-align: center;border-left: 1px solid #ddd;">1</td>
<td style="<?php echo $style; ?> text-align: right;border-left: 1px solid #ddd;">
<?php if (!empty($order->shipping->order->price['discount_enable'])): ?>
<div style="font-size: 12px; color: #ccc">
<s><?php echo $order->shipping->order->price['base_seo']; ?></s>
<?php echo ' ( - ' . $order->shipping->order->price['discount_seo'] . ')'; ?>
</div>
<?php endif; ?>
<div>
<?php echo str_replace(' ', '&nbsp;', $order->shipping->order->price['final_seo']); ?>
</div>
</td>
</tr>
<?php endif; ?>
</tbody>
<tfoot>
<tr>
Expand Down
2 changes: 1 addition & 1 deletion layouts/user/create.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
* @package RadicalMart Package
* @subpackage plg_radicalmart_message_email
* @version 1.1.0
* @version 1.1.1
* @author Delo Design - delo-design.ru
* @copyright Copyright (c) 2021 Delo Design. All rights reserved.
* @license GNU/GPL license: https://www.gnu.org/copyleft/gpl.html
Expand Down
2 changes: 1 addition & 1 deletion script.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
* @package RadicalMart Package
* @subpackage plg_radicalmart_message_email
* @version 1.1.0
* @version 1.1.1
* @author Delo Design - delo-design.ru
* @copyright Copyright (c) 2021 Delo Design. All rights reserved.
* @license GNU/GPL license: https://www.gnu.org/copyleft/gpl.html
Expand Down

0 comments on commit f6d6a87

Please sign in to comment.