PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 10.11.1
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v10.11.1
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
acymailing / back / dynamics / sendinblue / sender.php

sender.php in AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress 10.11.1, at back/dynamics/sendinblue/sender.php

49 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class SendinblueSender extends SendinblueClass
4 {
5 public function getSender($mail)
6 {
7 $response = $this->callApiSendingMethod('senders', [], $this->headers);
8
9 if (!empty($response['code'])) return false;
10
11 $data = [
12 'name' => empty($mail->from_name) ? $this->config->get('from_name') : $mail->from_name,
13 'email' => empty($mail->from_email) ? $this->config->get('from_email') : $mail->from_email,
14 ];
15
16 if (!empty($response['senders'])) {
17 foreach ($response['senders'] as $sender) {
18 if ($sender['email'] != $data['email']) continue;
19
20 return [
21 'name' => $sender['name'],
22 'id' => $sender['id'],
23 ];
24 }
25 }
26
27 $response = $this->callApiSendingMethod('senders', $data, $this->headers, 'POST');
28
29 if (!empty($response['code'])) return false;
30
31 return [
32 'name' => $data['name'],
33 'id' => $response['id'],
34 ];
35 }
36
37 public function getReplyToEmail($mail)
38 {
39 if (!empty($mail->reply_to_email)) return $mail->reply_to_email;
40
41 $fromEmail = $this->config->get('from_email');
42 $replyToEmail = $this->config->get('replyto_email');
43
44 if (!empty($this->config->get('from_as_replyto', 0))) return $fromEmail;
45
46 return empty($replyToEmail) ? $fromEmail : $replyToEmail;
47 }
48 }
49