| @@ -32,31 +32,29 @@ | ||
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | public function onAcymGetSendingMethodsHtmlSetting(&$data) |
| 35 | 35 | { |
| 36 | - ob_start(); | |
| 37 | 36 | ?> |
| 38 | - <div class="send_settings grid-x cell" id="<?php echo self::SENDING_METHOD_ID; ?>_settings"> | |
| 37 | + <div class="send_settings grid-x cell" id="<?php echo esc_attr(self::SENDING_METHOD_ID); ?>_settings"> | |
| 39 | 38 | <div class="cell grid-x acym_vcenter acym__sending__methods__one__settings"> |
| 40 | - <label for="<?php echo self::SENDING_METHOD_ID; ?>_password" class="cell shrink margin-right-1"> | |
| 41 | - <?php echo acym_translation('ACYM_API_KEY'); ?> | |
| 39 | + <label for="<?php echo esc_attr(self::SENDING_METHOD_ID); ?>_password" class="cell shrink margin-right-1"> | |
| 40 | + <?php echo esc_html(acym_translation('ACYM_API_KEY')); ?> | |
| 42 | 41 | </label> |
| 43 | 42 | <?php |
| 44 | - echo $this->getLinks( | |
| 43 | + $this->getLinks( | |
| 45 | 44 | 'https://elasticemail.com/referral-reward?r=7b884a0b-b979-4473-8803-06ae39d76599', |
| 46 | 45 | 'https://elasticemail.com/email-api-pricing?r=7b884a0b-b979-4473-8803-06ae39d76599' |
| 47 | 46 | ); |
| 48 | 47 | ?> |
| 49 | - <input id="<?php echo self::SENDING_METHOD_ID; ?>_password" | |
| 50 | - class="cell" | |
| 51 | - type="text" | |
| 52 | - name="config[<?php echo self::SENDING_METHOD_ID; ?>_password]" | |
| 53 | - value="<?php echo str_repeat('*', strlen($this->config->get(self::SENDING_METHOD_ID.'_password'))); ?>"> | |
| 54 | - <?php echo $this->getTestCredentialsSendingMethodButton(self::SENDING_METHOD_ID); ?> | |
| 48 | + <input id="<?php echo esc_attr(self::SENDING_METHOD_ID); ?>_password" | |
| 49 | + class="cell" | |
| 50 | + type="text" | |
| 51 | + name="config[<?php echo esc_attr(self::SENDING_METHOD_ID); ?>_password]" | |
| 52 | + value="<?php echo esc_attr(str_repeat('*', strlen($this->config->get(self::SENDING_METHOD_ID.'_password')))); ?>"> | |
| 53 | + <?php $this->getTestCredentialsSendingMethodButton(self::SENDING_METHOD_ID); ?> | |
| 55 | 54 | </div> |
| 56 | 55 | </div> |
| 57 | 56 | <?php |
| 58 | - $data['sendingMethodsHtmlSettings'][self::SENDING_METHOD_ID] = ob_get_clean(); | |
| 59 | 57 | } |
| 60 | 58 | |
| 61 | 59 | public function onAcymTestCredentialSendingMethod($sendingMethod, $credentials) |
| 62 | 60 | { |
| @@ -94,8 +92,9 @@ | ||
| 94 | 92 | array $bcc = [], |
| 95 | 93 | array $attachments = [], |
| 96 | 94 | $sendingMethodListParams = [] |
| 97 | 95 | ): void { |
| 96 | + // https://elasticemail.com/developers/api-documentation/rest-api#operation/emailsTransactionalPost | |
| 98 | 97 | if ($mailerHelper->externalMailer !== self::SENDING_METHOD_ID) { |
| 99 | 98 | return; |
| 100 | 99 | } |
| 101 | 100 | |
| @@ -175,8 +174,9 @@ | ||
| 175 | 174 | |
| 176 | 175 | if (!$this->attachmentsFetched) { |
| 177 | 176 | $this->attachmentsFetched = true; |
| 178 | 177 | |
| 178 | + // Uploaded attachments expire after 35 days by default, so 1000 should be more than enough | |
| 179 | 179 | $uploadedAttachments = $this->callApiSendingMethod( |
| 180 | 180 | self::SENDING_METHOD_API_URL.'files?limit=1000', |
| 181 | 181 | [], |
| 182 | 182 | $this->getAuthenticationHeaders() |
| @@ -296,8 +296,9 @@ | ||
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | private function cleanFileName(string $fileName): string |
| 299 | 299 | { |
| 300 | + // Replace accents with their non-accented equivalent | |
| 300 | 301 | if (function_exists('iconv')) { |
| 301 | 302 | $fileName = iconv('UTF-8', 'ASCII//TRANSLIT', $fileName); |
| 302 | 303 | } |
| 303 | 304 | |