Reputation: 1574
I am new to Laravel and am stuck. I've use the Hugo Firth api wrapper in Laravel for mailchimp. What I can't figure out is where to put this the code in laravel. Does it go on the controller? This is the code for subscribe:
MailChimpWrapper::lists()->subscribe($list_id, array('email' => $email_address));
I also need the list_id..do I put the list ID there or create a variable called $list_id = with my list id? or can I put it right on my landing page?
@section('content')
{{ MailChimpWrapper::lists()->subscribe($list_id, array('email' => $email_address)); }}
<div class="grid">
<div class="grid-9">
EDIT
public function index()
{
return View::make('landing/landing');
MailChimpWrapper::lists()->subscribe('list_id', array('email' => $email_address));
}
Upvotes: 1
Views: 2334
Reputation: 11
You're going to find the list ID in MailChimp. It's more of a static thing, than a variable. I only use 1 list, so it's actually just coded as a string for me.
And it goes in your controller, so this is what I have:
MailchimpWrapper::lists()->subscribe('list_id', ['email' => $email], [
'FNAME' => $firstname,
'LNAME' => $lastname
]);
Upvotes: 1