Laravel Spatie / Информационный бюллетень не добавляет контакт в Mailchimp - PullRequest
0 голосов
/ 20 декабря 2018

Я работаю над интеграцией моего приложения 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]);Странно то, что когда я использую тинкер для добавления контакта, он работает ">>> Newsletter :: subscribe ($ user-> email, [" FNAME "=> $ user-> first_name," LNAME "=> $ user-> last_name]); "Есть ли решение этой проблемы и как я могу ее решить?Спасибо

1 Ответ

0 голосов
/ 21 декабря 2018

Мне удалось решить эту проблему, изменив значение ssl по умолчанию с true на false.Кажется, у моего сервера были некоторые проблемы с соединениями https.Если кто-то сталкивается с подобной проблемой, он может попробовать установить 'ssl' => false в файле config / laravel-newsletter.php, возможно, это решит их проблему.

...