public function getMisconfigurationMessage(PostmanConfigTextHelper $scribe, PostmanOptionsInterface $options, PostmanOAuthToken $token) { if ($this->isOAuthCredentialsNeeded($options)) { return sprintf(__('OAuth 2.0 authentication requires a Client ID and Client Secret.', 'postman-smtp')); } else { if (!$this->isSenderConfigured($options)) { return __('Envelope From Address and Message From Address can not be empty.', 'postman-smtp'); } else { if ($this->isPermissionNeeded($token)) { $message = sprintf(__('You have configured OAuth 2.0 authentication, but have not received permission to use it.', 'postman-smtp'), $scribe->getClientIdLabel(), $scribe->getClientSecretLabel()); $message .= sprintf(' <a href="%s">%s</a>.', PostmanUtils::getGrantOAuthPermissionUrl(), $scribe->getRequestPermissionLinkText()); return $message; } } } }
public function getMisconfigurationMessage(PostmanConfigTextHelper $scribe, PostmanOptionsInterface $options, PostmanOAuthToken $token) { if (!$this->isHostConfigured($options)) { return __('Outgoing Mail Server Hostname and Port can not be empty.', 'postman-smtp'); } else { if (!$this->isSenderConfigured($options)) { return __('Envelope From Address and Message From Address can not be empty.', 'postman-smtp'); } else { if ($options->isAuthTypePassword() && !$this->isPasswordAuthenticationConfigured($options)) { return __('Password authentication (Plain/Login/CRAM-MD5) requires a username and password.', 'postman-smtp'); } else { if ($options->isAuthTypeOAuth2() && !$this->isOAuthAuthenticationConfigured($options)) { /* translators: %1$s is the Client ID label, and %2$s is the Client Secret label (e.g. Warning: OAuth 2.0 authentication requires an OAuth 2.0-capable Outgoing Mail Server, Sender Email Address, Client ID, and Client Secret.) */ return sprintf(__('OAuth 2.0 authentication requires a supported OAuth 2.0-capable Outgoing Mail Server, %1$s, and %2$s.', 'postman-smtp'), $scribe->getClientIdLabel(), $scribe->getClientSecretLabel()); } else { if ($this->isPermissionNeeded($options, $token)) { /* translators: %1$s is the Client ID label, and %2$s is the Client Secret label */ $message = sprintf(__('You have configured OAuth 2.0 authentication, but have not received permission to use it.', 'postman-smtp'), $scribe->getClientIdLabel(), $scribe->getClientSecretLabel()); $message .= sprintf(' <a href="%s">%s</a>.', PostmanUtils::getGrantOAuthPermissionUrl(), $scribe->getRequestPermissionLinkText()); return $message; } } } } } }