Skip to content

Commit

Permalink
Merge pull request #2 from aschroder/master
Browse files Browse the repository at this point in the history
Pull upstream changes
  • Loading branch information
Anton Kurnosov authored Nov 22, 2018
2 parents a1f9623 + f470ddd commit e83f3aa
Show file tree
Hide file tree
Showing 11 changed files with 166 additions and 25 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
Magento SMTP Pro Extension
Magento 1 SMTP Pro Extension
by Ashley Schroder (aschroder.com)

- Free and Opensource email extension for Magento
- Easily send Magento transactional emails via Google Apps, Gmail, Amazon SES or your own SMTP server.
- Test your conifguration from the Magento admin
- Free and Opensource email extension for Magento 1.x
- Easily send Magento transactional emails via Google Apps, Gmail, Amazon SES or your own SMTP server
- Test your configuration from the Magento admin
- View a log of all emails
- Improve deliverability with an external SMTP server

Contributors
- nl_NL translations thanks to [Melvyn Sopacua](http://www.supportdesk.nu/)
- es_ES translations thanks to [Jhoon Saravia](http://twitter.com/jsaravia)
- pt_BR translations thanks to [Gabriel Zamprogna] (https://github.com/gabrielz)
- pt_BR translations thanks to [Gabriel Zamprogna](https://github.com/gabrielz)
- fr_FR translations thanks to [@aymencis Aymen Hajri](https://github.com/aymencis)
- de_DE translations thanks to [@quafzi Thomas Birke](https://github.com/quafzi)

- ru_RU translations thanks to [Victor Ivanov](https://github.com/victorivanovspb)

FAQ

Q: It's not working
A: Check for extension conflicts, and check that your host allows outbound SMTP traffic
A: Check for extension conflicts, and check that your host allows outbound SMTP traffic.

Q: Does it work with the Mailchimp extension
A: yes, see: http://www.aschroder.com/2011/09/using-smtp-pro-and-ebizmarts-mailchimp-extension-in-magento/
A: Yes, see: http://www.aschroder.com/2011/09/using-smtp-pro-and-ebizmarts-mailchimp-extension-in-magento/.

Q: How do I install it manually
A: See: http://www.aschroder.com/2010/05/installing-a-magento-extension-manually-via-ftp-or-ssh/ or use modman.
Expand All @@ -38,4 +38,4 @@ A: It's actually good advice to learn more here: http://support.google.com/mail
2) If that does work, then Google may have blocked your server IP due to too many wrong passwords. You need to log in to gmail.com _from_ that IP - in order to answer the captcha and allow the IP through again. There's a few ways to do that - SOCKS proxy, X forward a browser, use Lynx.

Q: I am getting a Subject set twice error
A: This happens sometimes, typically if it is happening it would also be happening in core Magento. There is a Pull Request [here] (https://github.com/aschroder/Magento-SMTP-Pro-Email-Extension/pull/57) that includes a work around thanks to [Rafael Kassner] (https://github.com/kassner).
A: This happens sometimes, typically if it is happening it would also be happening in core Magento. There is a Pull Request [here](https://github.com/aschroder/Magento-SMTP-Pro-Email-Extension/pull/57) that includes a work around thanks to [Rafael Kassner](https://github.com/kassner).
5 changes: 5 additions & 0 deletions app/code/local/Aschroder/SMTPPro/Helper/Data.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ public function getAmazonSESPrivateKey($storeId = null)
return Mage::getStoreConfig('smtppro/general/ses_private_key', $storeId);
}

public function getAmazonSESRegion($storeId = null)
{
return Mage::getStoreConfig('smtppro/general/ses_region', $storeId);
}

public function getGoogleAppsEmail($storeId = null)
{
return Mage::getStoreConfig('smtppro/general/googleapps_email', $storeId);
Expand Down
4 changes: 3 additions & 1 deletion app/code/local/Aschroder/SMTPPro/Model/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ public function send() {
return $this;
}

$mail = new Zend_Mail();
$charset = Mage::getStoreConfigFlag('smtppro/charset/utf8') ? 'UTF-8' : null;
//set charset for the email
$mail = new Zend_Mail($charset);

if (strtolower($this->getType()) == 'html') {
$mail->setBodyHtml($this->getBody());
Expand Down
2 changes: 1 addition & 1 deletion app/code/local/Aschroder/SMTPPro/Model/Email/Queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function send()
Mage::logException($e);
Mage::setIsDeveloperMode($oldDevMode);

return false;
continue;
}

// after each valid message has been sent - pause if required
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
/**
* @author Fabrizio Branca
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Aschroder_SMTPPro_Model_System_Config_Source_Smtp_Awsregions
{
public function toOptionArray()
{
return array(
'us-east-1' => Mage::helper('adminhtml')->__('US East (N. Virginia)'),
'us-west-2' => Mage::helper('adminhtml')->__('US West (Oregon)'),
'eu-west-1' => Mage::helper('adminhtml')->__('EU (Ireland)')
);
}
}
5 changes: 3 additions & 2 deletions app/code/local/Aschroder/SMTPPro/Model/Transports/Ses.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Aschroder_SMTPPro_Model_Transports_Ses {

public function getTransport($storeId) {

$_helper = Mage::helper('smtppro');
$_helper = Mage::helper('smtppro'); /* @var $_helper Aschroder_SMTPPro_Helper_Data */
$_helper->log("Getting Amazon SES Transport");

$path = Mage::getModuleDir('', 'Aschroder_SMTPPro');
Expand All @@ -26,7 +26,8 @@ public function getTransport($storeId) {
array(
'accessKey' => $_helper->getAmazonSESAccessKey($storeId),
'privateKey' => $_helper->getAmazonSESPrivateKey($storeId)
)
),
'https://email.'.$_helper->getAmazonSESRegion($storeId).'.amazonaws.com'
);

return $emailTransport;
Expand Down
1 change: 1 addition & 0 deletions app/code/local/Aschroder/SMTPPro/etc/config.xml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
<mailup_password backend_model="adminhtml/system_config_backend_encrypted" />
<ses_access_key></ses_access_key>
<ses_private_key backend_model="adminhtml/system_config_backend_encrypted" />
<ses_region>us-east-1</ses_region>
<smtp_authentication></smtp_authentication>
<smtp_username></smtp_username>
<smtp_password backend_model="adminhtml/system_config_backend_encrypted" />
Expand Down
30 changes: 30 additions & 0 deletions app/code/local/Aschroder/SMTPPro/etc/system.xml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,16 @@
<show_in_store>0</show_in_store>
<depends><option>ses</option></depends>
</ses_private_key>
<ses_region translate="label">
<label>Amazon SES Region</label>
<frontend_type>select</frontend_type>
<source_model>smtppro/system_config_source_smtp_awsregions</source_model>
<sort_order>24</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
<depends><option>ses</option></depends>
</ses_region>

<smtp_authentication translate="label">
<label>Authentication</label>
Expand Down Expand Up @@ -308,6 +318,26 @@
</logenabled>
</fields>
</esp>
<charset module="smtppro" translate="label">
<label>Charset</label>
<frontend_type>text</frontend_type>
<sort_order>90</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<fields>
<utf8 translate="utf-8">
<label>Enable UTF-8</label>
<comment>Enable UTF-8 charset for the emails</comment>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>40</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
</utf8>
</fields>
</charset>
</groups>
</smtppro>
</sections>
Expand Down
Loading

0 comments on commit e83f3aa

Please sign in to comment.