| .. | .. |
|---|
| 56 | 56 | * @throws SeCurisException |
|---|
| 57 | 57 | */ |
|---|
| 58 | 58 | public EmailManager() throws SeCurisException { |
|---|
| 59 | | - String domain = Params.get(Params.KEYS.MAILGUN_DOMAIN); |
|---|
| 59 | + String domain = Config.get(Config.KEYS.MAILGUN_DOMAIN); |
|---|
| 60 | 60 | if (domain == null) { |
|---|
| 61 | | - throw new SeCurisException("Please, add '" + Params.KEYS.MAILGUN_DOMAIN + "' parameter to config file"); |
|---|
| 61 | + throw new SeCurisException("Please, add '" + Config.KEYS.MAILGUN_DOMAIN + "' parameter to config file"); |
|---|
| 62 | 62 | } |
|---|
| 63 | 63 | serverUrl = String.format("https://api.mailgun.net/v2/%s/messages", domain); |
|---|
| 64 | 64 | httpClient = createHttpClient(); |
|---|
| .. | .. |
|---|
| 81 | 81 | throw new SeCurisException("Error creating SSL socket factory"); |
|---|
| 82 | 82 | } |
|---|
| 83 | 83 | CredentialsProvider provider = new BasicCredentialsProvider(); |
|---|
| 84 | | - UsernamePasswordCredentials credentials = new UsernamePasswordCredentials("api", Params.get(Params.KEYS.MAILGUN_API_KEY)); |
|---|
| 84 | + UsernamePasswordCredentials credentials = new UsernamePasswordCredentials("api", Config.get(Config.KEYS.MAILGUN_API_KEY)); |
|---|
| 85 | 85 | provider.setCredentials(AuthScope.ANY, credentials); |
|---|
| 86 | 86 | |
|---|
| 87 | 87 | return HttpClientBuilder.create().setDefaultCredentialsProvider(provider).setSSLSocketFactory(sslsf).build(); |
|---|
| .. | .. |
|---|
| 105 | 105 | |
|---|
| 106 | 106 | builder.setCharset(Charset.forName("utf-8")); |
|---|
| 107 | 107 | builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE); |
|---|
| 108 | | - builder.addTextBody("from", Params.get(Params.KEYS.EMAIL_FROM_ADDRESS)); |
|---|
| 108 | + builder.addTextBody("from", Config.get(Config.KEYS.EMAIL_FROM_ADDRESS)); |
|---|
| 109 | 109 | builder.addTextBody("to", to); |
|---|
| 110 | 110 | if (cc != null) { |
|---|
| 111 | 111 | builder.addTextBody("cc", cc); |
|---|