PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 11.0.4
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v11.0.4
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 11.0.4, at back/dynamics/sendinblue/transactional.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 SendinblueTransactional extends SendinblueClass
4 {
5 public function sendTransactionalEmail(&$response, $sendingMethod, $to, $subject, $from, $reply_to, $body, $bcc = [], $attachments = [])
6 {
7 //https://developers.brevo.com/docs/send-a-transactional-email
8 if ($sendingMethod != plgAcymSendinblue::SENDING_METHOD_ID) return;
9 $data = [
10 'sender' => $from,
11 'replyTo' => $reply_to,
12 'to' => [
13 [
14 'email' => acym_strtolower($to['email']),
15 ],
16 ],
17 'subject' => $subject,
18 'htmlContent' => $body,
19 ];
20
21 if (!empty($bcc)) {
22 $data['bcc'] = [
23 [
24 'email' => $bcc[0][0],
25 ],
26 ];
27 }
28
29 if (!empty($attachments)) {
30 $data['attachment'] = [];
31 foreach ($attachments as $key => $attachment) {
32 $data['attachment'][] = [
33 'content' => $attachment['contentEncoded'],
34 'name' => $attachment[1],
35 ];
36 }
37 }
38
39 $responseMailer = $this->callApiSendingMethod('smtp/email', $data, $this->headers, 'POST');
40
41 if (!empty($responseMailer['code'])) {
42 $response['error'] = true;
43 $response['message'] = $responseMailer['message'];
44 } else {
45 $response['error'] = false;
46 }
47 }
48 }
49