AhmedSamy / HypeMailchimpBundle

Symfony2 Mailchimp API V2
MIT License
53 stars 21 forks source link

how to add subscriber name? #28

Closed shairyar closed 9 years ago

shairyar commented 9 years ago

Hi,

Thanks for sharing the bundle, i got it to work just fine, I can get the subscriber added using email however i cant seem to find a way to add subscriber first and last name?

Even your subscribe function does not seem to be taking any names

public function subscribe($email_id, $email_type = 'html', $double_optin = true, $update_existing = true, $replace_interests = true, $send_welcome = false, $email_identifier = 'email') {
luishdez commented 9 years ago

@shairyar

Use merge vars

<?php

$mca = $this->get('hype_mailchimp');
$mca->getList()
    ->addMerge_vars(
        array(
            'FNAME' => 'Jhon',
            'LNAME' => 'Doe'
        )
    )
    ->subscribe('jhon.doe@gmail.com');