我使用山魈API但得到error:Undefined property: Mandrill::$messages.code:
$mandrill = new Mandrill('My KEY');
$message = array(
'subject' => 'My subject',
'from_email' => '[email protected]',
'to' => array(array('email' => '[email protected]', 'name'=> 'Marc')),
'merge_vars' => array(array(
'rcpt' => '[email protected]',
'vars' =>
array(
array(
'name' => 'FIRSTNAME',
'content' => 'Recipient 1 first name'),
array(
'name' => 'LASTNAME',
'content' => 'Last name')
))));
$template_name = 'Lodging Connection';
$template_content = array(
array(
'name' => 'main',
'content' => 'Hi *|FIRSTNAME|* *|LASTNAME|*, thanks for signing up.'),
array(
'name' => 'footer',
'content' => 'Copyright 2013.')
);
$response = $mandrill->messages->send($template_name, $template_content, $message);
print_r($response);
是'$ message = array()'不應該是'$ messages = array()'?或者將'$ mandrill-> messages-> send()'改爲'$ mandrill-> message-> send()' –