我正在使用Codeigniter框架并尝试与SendInBlue的PHP API集成.他们的PHP文档并不是非常有用,Github上的设置说明也不清楚.
该文档说"下载文件并包含autoload.php":
require_once('/path/to/APIv3-php-library/vendor/autoload.php');
Run Code Online (Sandbox Code Playgroud)
但我找不到autoload
任何地方,我不确定如何在我的CI结构中包含它.
更新:
我联系了Sendinblue支持,他们没有CI用户的任何安装教程.我尝试使用Compiler,并创建了文件夹结构,但我仍然遇到与CI集成的问题.我将所有文件夹放在我的库中,但没有正确加载并抱怨Autoload类不存在.
我使用此处的确切代码https://developers.sendinblue.com/reference/addcontacttolist-1将用户添加到列表中。一切正常,用户被创建/更新(如果存在),然后用户被添加到列表中。但是,当添加到列表时,它会引发错误。
调用 AddContactToList 时出错:{“code”:“invalid_parameter”,“message”:“联系人已在列表中和/或不存在”}
他们的代码显示 JSON 格式的显示结果,该结果永远不会被命中,因为它会抛出 Add 方法。
Since yesterday I've been trying to pass parameters through the SendInBlue API but it just doesn't work. I've tried everything. I've seen many code examples, but unfortunately it doesn't work.
I even used as an example the code in C# that they put on their website and it still doesn't work.
Follow my code:
using System.Diagnostics;
using System.Net.Http.Headers;
using Newtonsoft.Json.Linq;
using sib_api_v3_sdk.Api;
using sib_api_v3_sdk.Client;
using sib_api_v3_sdk.Model;
using Task = System.Threading.Tasks.Task;
namespace cjuridico.Domain.Models.Email;
public static class CadastroEmail
{
public static async …
Run Code Online (Sandbox Code Playgroud) 我想使用 Sendinblue 通过 SMTP 从我的 Ruby on Rails Web 应用程序发送事务电子邮件。我编辑config/environments/production.rb
如下:
ActionMailer::Base.smtp_settings = {
:address => 'smtp-relay.sendinblue.com',
:port => '587',
:authentication => :plain,
:user_name => ???,
:password => ???,
:domain => 'fireworks.com',
:enable_starttls_auto => true
}
Run Code Online (Sandbox Code Playgroud)
我应该使用什么 asuser_name
和password
?我的帐户的用户名和密码还是我的 SMTP 密钥?另外,我是否需要使用任何 gem,例如sib-api-v3-sdk
,或者该 gem 仅适用于使用 Sendinblue API 发送电子邮件?
我正在尝试使用 sendinblue 发送电子邮件,但遇到问题“模块‘sib_api_v3_sdk’没有属性‘SMTPApi’”。
我用 pip 安装了 sib_api_v3_sdk 并且使用 python 3.8.5
from __future__ import print_function
import time
import sib_api_v3_sdk
from sib_api_v3_sdk.rest import ApiException
from pprint import pprint
# Configure API key authorization: api-key
configuration = sib_api_v3_sdk.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below lines to configure API key authorization using: partner-key
# configuration = sib_api_v3_sdk.Configuration()
# configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# create an instance of the API class
api_instance = sib_api_v3_sdk.SMTPApi(sib_api_v3_sdk.ApiClient(configuration))
send_smtp_email = sib_api_v3_sdk.SendSmtpEmail(to=[{"email":"testmail@example.com","name":"John Doe"}], template_id=56, params={"name": "John", "surname": "Doe"}, headers={"X-Mailin-custom": "custom_header_1:custom_value_1|custom_header_2:custom_value_2|custom_header_3:custom_value_3", "charset": …
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用此处的SendInBlue API 发送事件。
当我发送事件时,它正确返回 204 - 但我在这里没有收到任何事件,并且我创建了一个由事件触发的自动化流程,但它不发送。
const axios = require("axios");
const url = 'https://in-automate.sendinblue.com/api/v2/trackEvent';
(async() => {
try {
const event = await axios.post(
url,
JSON.stringify( {
email: 'myemail@emailprovider.co',
event: 'USER_SUBSCRIBED'
}),
{
Accept: 'application/json',
'Content-Type': 'application/json',
'ma-key': 'xkeysib-MY_v3_API_KEY'
},
);
console.log(event);
} catch (err) {
console.log(JSON.stringify(err))
}
})();
Run Code Online (Sandbox Code Playgroud)
有没有办法可以在控制台上看到此调用中传入的事件?