我正在研究laravel 5.2应用程序与MailChimp之间的集成。我已经下载并安装了spatie / newsletter https://github.com/spatie/laravel-newsletter,但由于某些原因导致集成无法正常工作,这意味着未在mailchimp中创建联系人。我在config / app.php文件中添加了提供程序和别名,config / larave-newsletter.php文件包含正确的设置
/*
* The api key of a MailChimp account. You can find yours here:
* https://us10.admin.mailchimp.com/account/api-key-popup/
*/
'apiKey' => env('MAILCHIMP_APIKEY'),
/*
* When not specifying a listname in the various methods, use the list with this name
*/
'defaultListName' => 'ListName',
/*
* Here you can define properties of the lists you want to
* send campaigns.
*/
'lists' => [
/*
* This key is used to identify this list. It can be used
* in the various methods provided by this package.
*
* You can set it to any string you want and you can add
* as many lists as you want.
*/
'subscribers' => [
/*
* A mail chimp list id. Check the mailchimp docs if you don't know
* how to get this value:
* http://kb.mailchimp.com/lists/managing-subscribers/find-your-list-id
*/
'id' => env('MAILCHIMP_LIST_ID'),
],
],
/*
* If you're having trouble with https connections, set this to false.
*/
'ssl' => true,
我的控制器包含以下内容:Newsletter :: subscribe($ user-> email,['FNAME'=> $ user-> first_name,'LNAME'=> $ user-> last_name]); 奇怪的是,当我使用修补匠添加联系人时,它确实起作用 “ >>>新闻稿::订阅($ user-> email,[” FNAME“ => $ user-> first_name,” LNAME“ => $ u ser-> last_name]); ” 有没有解决此问题的方法,我该如何解决?谢谢
答案 0 :(得分:0)
我能够通过将默认ssl设置从true更改为false来解决此问题。看来我的服务器与https连接存在一些问题。 如果遇到类似问题,他们可以尝试在config / laravel-newsletter.php文件中设置'ssl'=> false,也许可以解决他们的问题。
答案 1 :(得分:0)
我解决了相同的问题
运行以下命令: