Emails
Overview of emails API methods
Last updated
{
"result": true
}var client = new CodeMashClient(apiKey, projectId);
var emailService = new CodeMashEmailService(client);
var response = await emailService.SendEmailAsync(new SendEmailRequest
{
TemplateId = Guid.Parse("{TEMPLATE_ID}"),
Emails = new [] { "test@email.com" }
});use Codemash\CodemashClient;
use Codemash\CodemashEmail;
class CodemashService
{
protected CodemashEmail $codemashEmail;
public function __construct()
{
$secretKey = '{YOUR_SECRET_KEY}';
$projectId = '{YOUR_PROJECT_ID}';
$client = new CodemashClient($secretKey, $projectId);
$this->codemashEmail = new CodemashEmail($client);
}
public function sendEmail()
{
$responseData = $this->codemashEmail->send([
'templateId' => '{TEMPLATE_ID}',
'emails' => [
'test1@example.com',
'test2@example.com',
'test3@example.com',
],
]);
}
}