0

我们目前正在使用 Sendinblue 作为邮件营销提供商,并且确实在我们的 Wordpress/Woocommerce 商店中设置了它来处理营销和交易电子邮件。

在此之前,我们曾经发送一些交易 woocommerce 交易电子邮件,例如密件抄送中的 order_completed 到我们自己的电子邮件地址之一。这对于某些内部流程是必要的。

因此 Sendinblue 接管了,这个函数没有被触发,或者更像是被触发但不再通过 Sendinblue 处理。

虽然,我发现一个 API 调用实际上可以做到这一点:https ://developers.sendinblue.com/reference#sendtransacemail

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.sendinblue.com/v3/smtp/email",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"bcc\":[{\"email\":\"something@domain.com\"}]}",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

除此之外:https ://apidocs.sendinblue.com/tutorial-sending-transactional-email/

不过,我绝对不确定在哪里添加它以通过 Sendinblue 触发密件抄送。

如果有人能指出我正确的方向,那就太棒了。

亲切的问候克里斯

4

1 回答 1

0

you don't have to use the API calls to be able to use Sendinblue for Email. What you should do is just making Sendinblue as your Email Server by entering your Sendinblue server details as your Wordpress default SMTP server. You can use the following code to do so.

If you do the above your website will function normally and all triggers will work just fine, the only thing if that your website will use Sendinblue as it's Email Server and all the sent emails will be logged to your Sendinblue account.

  1. How to get your Sendinblue SMTP account working: https://help.sendinblue.com/hc/en-us/articles/209463245--How-can-I-get-my-SendinBlue-SMTP-account-activated-

  2. Very simple article to help you with configuring your SMTP: https://help.dreamhost.com/hc/en-us/articles/215526937-Configuring-the-WP-Mail-SMTP-plugin

Good luck!

于 2020-02-15T15:09:04.473 回答