diff --git a/assets/js/src/settings/tabs.js b/assets/js/src/settings/tabs.js index 860581c9c4..66acc817a4 100644 --- a/assets/js/src/settings/tabs.js +++ b/assets/js/src/settings/tabs.js @@ -15,10 +15,10 @@ define( MailPoet.Router = new (Backbone.Router.extend({ routes: { - 'mta(/:method)': 'sendingMethod', + 'mta(/:group)': 'sendingMethodGroup', '(:tab)': 'tabs', }, - sendingMethod: function(method) { + sendingMethodGroup: function(group) { // display mta tab this.tabs('mta'); @@ -30,13 +30,13 @@ define( // hide "save settings" button jQuery('.mailpoet_settings_submit').hide(); - if(method === null) { + if(group === null) { // show sending methods jQuery('.mailpoet_sending_methods').fadeIn(); } else { // hide DKIM option when using MailPoet's API jQuery('#mailpoet_mta_dkim')[ - (method === 'MailPoet') + (group === 'mailpoet') ? 'hide' : 'show' ](); @@ -45,7 +45,7 @@ define( jQuery('.mailpoet_sending_methods').hide(); // display selected sending method's settings - jQuery('.mailpoet_sending_method[data-method="'+ method +'"]').show(); + jQuery('.mailpoet_sending_method[data-group="'+ group +'"]').show(); jQuery('#mailpoet_sending_method_setup').fadeIn(); } }, diff --git a/lib/Settings/Hosts.php b/lib/Settings/Hosts.php index fc9d125543..1a4a064438 100644 --- a/lib/Settings/Hosts.php +++ b/lib/Settings/Hosts.php @@ -5,27 +5,43 @@ class Hosts { private static $_smtp = array( 'AmazonSES' => array( 'name' => 'Amazon SES', - 'api' => false, 'emails' => 100, - 'interval' => 5 + 'interval' => 5, + 'fields' => array( + 'region', + 'access_key', + 'secret_key' + ), + 'regions' => array( + 'US East (N. Virginia)' => 'us-east-1.amazonaws.com', + 'US West (Oregon)' => 'us-west-2.amazonaws.com', + 'EU (Ireland)' => 'eu-west-1.amazonaws.com' + ) ), 'ElasticEmail' => array( 'name' => 'ElasticEmail', - 'api' => true, 'emails' => 100, - 'interval' => 5 + 'interval' => 5, + 'fields' => array( + 'api_key' + ) ), 'MailGun' => array( 'name' => 'MailGun', - 'api' => false, 'emails' => 100, - 'interval' => 5 + 'interval' => 5, + 'fields' => array( + 'domain', + 'api_key' + ) ), 'SendGrid' => array( 'name' => 'SendGrid', - 'api' => true, 'emails' => 100, - 'interval' => 5 + 'interval' => 5, + 'fields' => array( + 'api_key' + ) ) ); diff --git a/views/settings/mta.html b/views/settings/mta.html index cca8431a19..1a7f645811 100644 --- a/views/settings/mta.html +++ b/views/settings/mta.html @@ -10,7 +10,14 @@ } } %> - + + +