Questions? Feedback? powered by Olark live chat software

Newsman API Page

Newsman API » Newsman API 1.0 » Message » message.send_template

Newsman Api Method: message.send_template

Prototype: message.send_template($key, $account_id, $message, $recipients, $global_params)

Description: Sends a mail message over http API using a stored template

Return: struct (Returns a list with entries of dict (email, status, reason, send_id) for each recipient)

Variable Type Description
$key string API key
$account_id string
$message struct json dict with message data (must have html_template_id or text_template_id)
$recipients struct json list with recipients of the message – max 25000
$global_params struct json dict with global variables (parameters) used for the html / text template

Curl Code Example

curl -H "Content-Type: application/json" -X POST -d @test_call.json https://cluster.newsmanapp.com/api/1.0/message.send_template
 
{
  "key": "your_api_key",
  "account_id": "your_account_id",
 
  "message": {
      "from_name": "Test Company",
      "from_email": "test@company.com",
 
      // "replyto_name": "Test Company", 
      // "replyto_email": "test@company.com",
 
      "html_template_id": "your_template_id_here",
 
      "subject": "Message for {{name}}",
 
      // "bcc": "bcc@example.com,bcc2@example.com",
 
      "headers": [
          {"name": "X-Your-Tags", "value": "test,notification"}
      ],
 
      "template_engine": "handlebars"
  },
 
  "recipients": [
      { "email": "recipient-1@company.com", "name": "Recipient 1", "params": {"name": "Johnny"}  },
      { "email": "recipient-2@company.com", "name": "Recipient 2", "params": {"name": "Mark"} }
  ],
 
  "global_params": {
      "feel": "GOOD"
  }
}