0

So I've made a template called 'Basic' within Mandrill. I did a test send and it looks great. I put Mandrill into test mode and used the test API key in my code. I'm just trying to get the php to send out a test transactional email, but no email gets sent. Here is the printed response I get:

Array ( [0] => Array ( [email] => amiecrutchley02@gmail.com [status] => sent [_id] => 89bfab4c3938486eb9e36564f79a3e9f [reject_reason] => ) )

So I'm really not sure why I'm not receiving anything.

Here is my code:

<?php 
require_once('includes/mandrill/Mandrill.php');

$mandrill = new Mandrill('my_api_key');

$message = array(
    'subject' => 'Thank You For Your Purchase',
    'from_email' => 'no-reply@acq.com',
    'from_name' => 'ACQ',
    'to' => array(array('email' => 'amiecrutchley02@gmail.com', 'name' => 'Amie')),
    'merge_vars' => array(array(
        'rcpt' => 'amiecrutchley02@gmail.com',
        'vars' =>
        array(
            array(
                'name' => 'FIRSTNAME',
                'content' => 'Amie'),
            array(
                'name' => 'LASTNAME',
                'content' => 'Crutchley')
    ))));

$template_name = 'Basic';

$template_content = array(
    array(
        'name' => 'main',
        'content' => 'Hi *|FIRSTNAME|* *|LASTNAME|*, your profile has been updated!'),
    array(
        'name' => 'footer',
        'content' => 'ACQ, Copyright 2014')

);

$response = $mandrill->messages->sendTemplate($template_name, $template_content, $message);
print_r($response);


?>
Amie Crutchley
  • 121
  • 1
  • 2
  • 12

2 Answers2

3

a test API key is specifically designed to not send email. It's designed so you can mimic sending email, but doesn't actually send. You're also not charged for sending tests. Here's the Mandrill KB about what test mode is, and how it works: Does Mandrill have a test mode or sandbox?

Kaitlin
  • 6,167
  • 32
  • 30
0

Well, weird, but my test API was the problem. I tried the public API and boom! It works!

Amie Crutchley
  • 121
  • 1
  • 2
  • 12