Create a key to copy examples filled with your team.
Send emails with PHP
POST /sends with cURL.
POST /sends with cURL. PostShiba has no official package.
send.php
1
<?php
2
$ch = curl_init("https://postshiba.com/api/v1/teams/1/clusters/4/sends");
3
curl_setopt_array($ch, [
4
CURLOPT_POST => true,
5
CURLOPT_HTTPHEADER => [
6
"Authorization: Bearer YOUR_API_KEY",
7
"Content-Type: application/json",
8
],
9
CURLOPT_POSTFIELDS => json_encode([
10
"send" => [
11
"from" => "hello@mail.example.com",
12
"to" => ["you@example.com"],
13
"subject" => "PostShiba test",
14
"text" => "hello from PostShiba",
15
"html" => "<p>hello from PostShiba</p>",
16
"unique_args" => ["campaign_id" => "cmp_123", "site" => "docs"],
17
],
18
]),
19
CURLOPT_RETURNTRANSFER => true,
20
]);
21
echo curl_exec($ch);