summaryrefslogtreecommitdiff
path: root/Postman/Postman-Mail/PostmanSendGridTransport.php
diff options
context:
space:
mode:
authorNiels de Blaauw <niels@level-level.com>2019-03-13 09:42:41 +0100
committerNiels de Blaauw <niels@level-level.com>2019-03-13 09:42:41 +0100
commitfd70868a4b7c569ff5eeddfa36b71709c24b3555 (patch)
tree92a5412dcea553a72a2ab90971ec42bba8331481 /Postman/Postman-Mail/PostmanSendGridTransport.php
parentc88e7ad0b42cefd8fb7b509c8c2e355f567d9434 (diff)
downloadPost-SMTP-fd70868a4b7c569ff5eeddfa36b71709c24b3555.zip
Fixes #1, deprecates and replaces variable text domain usage
This should be removed as it breaks compatibility with translate.wordpress.org
Diffstat (limited to 'Postman/Postman-Mail/PostmanSendGridTransport.php')
-rw-r--r--Postman/Postman-Mail/PostmanSendGridTransport.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/Postman/Postman-Mail/PostmanSendGridTransport.php b/Postman/Postman-Mail/PostmanSendGridTransport.php
index 358fcc5..8a40f47 100644
--- a/Postman/Postman-Mail/PostmanSendGridTransport.php
+++ b/Postman/Postman-Mail/PostmanSendGridTransport.php
@@ -36,7 +36,7 @@ class PostmanSendGridTransport extends PostmanAbstractModuleTransport implements
return self::SLUG;
}
public function getName() {
- return __ ( 'SendGrid API', Postman::TEXT_DOMAIN );
+ return __ ( 'SendGrid API', 'post-smtp' );
}
/**
* v0.2.1
@@ -76,7 +76,7 @@ class PostmanSendGridTransport extends PostmanAbstractModuleTransport implements
}
public function getDeliveryDetails() {
/* translators: where (1) is the secure icon and (2) is the transport name */
- return sprintf ( __ ( 'Postman will send mail via the <b>%1$s %2$s</b>.', Postman::TEXT_DOMAIN ), '🔐', $this->getName () );
+ return sprintf ( __ ( 'Postman will send mail via the <b>%1$s %2$s</b>.', 'post-smtp' ), '🔐', $this->getName () );
}
/**
@@ -98,11 +98,11 @@ class PostmanSendGridTransport extends PostmanAbstractModuleTransport implements
$messages = parent::validateTransportConfiguration ();
$apiKey = $this->options->getSendGridApiKey ();
if (empty ( $apiKey )) {
- array_push ( $messages, __ ( 'API Key can not be empty', Postman::TEXT_DOMAIN ) . '.' );
+ array_push ( $messages, __ ( 'API Key can not be empty', 'post-smtp' ) . '.' );
$this->setNotConfiguredAndReady ();
}
if (! $this->isSenderConfigured ()) {
- array_push ( $messages, __ ( 'Message From Address can not be empty', Postman::TEXT_DOMAIN ) . '.' );
+ array_push ( $messages, __ ( 'Message From Address can not be empty', 'post-smtp' ) . '.' );
$this->setNotConfiguredAndReady ();
}
return $messages;
@@ -145,7 +145,7 @@ class PostmanSendGridTransport extends PostmanAbstractModuleTransport implements
$overrideItem ['auth_items'] = array (
array (
'selected' => true,
- 'name' => __ ( 'API Key', Postman::TEXT_DOMAIN ),
+ 'name' => __ ( 'API Key', 'post-smtp' ),
'value' => 'api_key'
)
);
@@ -174,25 +174,25 @@ class PostmanSendGridTransport extends PostmanAbstractModuleTransport implements
*/
public function addSettings() {
// the SendGrid Auth section
- add_settings_section ( PostmanSendGridTransport::SENDGRID_AUTH_SECTION, __ ( 'Authentication', Postman::TEXT_DOMAIN ), array (
+ add_settings_section ( PostmanSendGridTransport::SENDGRID_AUTH_SECTION, __ ( 'Authentication', 'post-smtp' ), array (
$this,
'printSendGridAuthSectionInfo'
), PostmanSendGridTransport::SENDGRID_AUTH_OPTIONS );
- add_settings_field ( PostmanOptions::SENDGRID_API_KEY, __ ( 'API Key', Postman::TEXT_DOMAIN ), array (
+ add_settings_field ( PostmanOptions::SENDGRID_API_KEY, __ ( 'API Key', 'post-smtp' ), array (
$this,
'sendgrid_api_key_callback'
), PostmanSendGridTransport::SENDGRID_AUTH_OPTIONS, PostmanSendGridTransport::SENDGRID_AUTH_SECTION );
}
public function printSendGridAuthSectionInfo() {
/* Translators: Where (1) is the service URL and (2) is the service name and (3) is a api key URL */
- printf ( '<p id="wizard_sendgrid_auth_help">%s</p>', sprintf ( __ ( 'Create an account at <a href="%1$s" target="_blank">%2$s</a> and enter <a href="%3$s" target="_blank">an API key</a> below.', Postman::TEXT_DOMAIN ), 'https://sendgrid.com', 'SendGrid.com', 'https://app.sendgrid.com/settings/api_keys' ) );
+ printf ( '<p id="wizard_sendgrid_auth_help">%s</p>', sprintf ( __ ( 'Create an account at <a href="%1$s" target="_blank">%2$s</a> and enter <a href="%3$s" target="_blank">an API key</a> below.', 'post-smtp' ), 'https://sendgrid.com', 'SendGrid.com', 'https://app.sendgrid.com/settings/api_keys' ) );
}
/**
*/
public function sendgrid_api_key_callback() {
- printf ( '<input type="password" autocomplete="off" id="sendgrid_api_key" name="postman_options[sendgrid_api_key]" value="%s" size="60" class="required" placeholder="%s"/>', null !== $this->options->getSendGridApiKey () ? esc_attr ( PostmanUtils::obfuscatePassword ( $this->options->getSendGridApiKey () ) ) : '', __ ( 'Required', Postman::TEXT_DOMAIN ) );
+ printf ( '<input type="password" autocomplete="off" id="sendgrid_api_key" name="postman_options[sendgrid_api_key]" value="%s" size="60" class="required" placeholder="%s"/>', null !== $this->options->getSendGridApiKey () ? esc_attr ( PostmanUtils::obfuscatePassword ( $this->options->getSendGridApiKey () ) ) : '', __ ( 'Required', 'post-smtp' ) );
print ' <input type="button" id="toggleSendGridApiKey" value="Show Password" class="button button-secondary" style="visibility:hidden" />';
}
@@ -219,7 +219,7 @@ class PostmanSendGridTransport extends PostmanAbstractModuleTransport implements
public function printWizardAuthenticationStep() {
print '<section class="wizard_sendgrid">';
$this->printSendGridAuthSectionInfo ();
- printf ( '<label for="api_key">%s</label>', __ ( 'API Key', Postman::TEXT_DOMAIN ) );
+ printf ( '<label for="api_key">%s</label>', __ ( 'API Key', 'post-smtp' ) );
print '<br />';
print $this->sendgrid_api_key_callback ();
print '</section>';