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 / transactional.php

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

48 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 SendinblueTransactional extends SendinblueClass
4 {
5 public function sendTransactionalEmail(&$response, $sendingMethod, $to, $subject, $from, $reply_to, $body, $bcc = [], $attachments = [])
6 {
7 if ($sendingMethod != plgAcymSendinblue::SENDING_METHOD_ID) return;
8 $data = [
9 'sender' => $from,
10 'replyTo' => $reply_to,
11 'to' => [
12 [
13 'email' => acym_strtolower($to['email']),
14 ],
15 ],
16 'subject' => $subject,
17 'htmlContent' => $body,
18 ];
19
20 if (!empty($bcc)) {
21 $data['bcc'] = [
22 [
23 'email' => $bcc[0][0],
24 ],
25 ];
26 }
27
28 if (!empty($attachments)) {
29 $data['attachment'] = [];
30 foreach ($attachments as $key => $attachment) {
31 $data['attachment'][] = [
32 'content' => $attachment['contentEncoded'],
33 'name' => $attachment[1],
34 ];
35 }
36 }
37
38 $responseMailer = $this->callApiSendingMethod('smtp/email', $data, $this->headers, 'POST');
39
40 if (!empty($responseMailer['code'])) {
41 $response['error'] = true;
42 $response['message'] = $responseMailer['message'];
43 } else {
44 $response['error'] = false;
45 }
46 }
47 }
48