我是Laravel的新手,我被困住了。我在Laravel for mailchimp中使用了Hugo Firth应用程序接口包装器。我搞不懂的是把这个代码放在laravel的什么地方。它会出现在控制器上吗?subscribe的代码如下:
MailChimpWrapper::lists()->subscribe($list_id, array('email' => $email_address));我还需要将列表id放在那里的list_id..do,或者使用列表ID创建一个名为$list_id =的变量?或者我可以把它直接放到我的登录页面上?
@section('content')
{{ MailChimpWrapper::lists()->subscribe($list_id, array('email' => $email_address)); }}
<div class="grid">
<div class="grid-9">编辑
public function index()
{
return View::make('landing/landing');
MailChimpWrapper::lists()->subscribe('list_id', array('email' => $email_address));
}发布于 2014-05-28 10:20:36
您将在MailChimp中找到列表ID。它更像是一个静态的东西,而不是一个变量。我只使用了1个list,所以它实际上只是为我编写了一个字符串。
然后放入你的控制器,这就是我所拥有的:
MailchimpWrapper::lists()->subscribe('list_id', ['email' => $email], [
'FNAME' => $firstname,
'LNAME' => $lastname
]);https://stackoverflow.com/questions/23901775
复制相似问题