Links

Emails

Overview of emails API methods
post
https://api.codemash.io
/:version/notifications/email
Send Email
.NET
Node
PHP
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 [] { "[email protected]" }
});
​
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' => [
],
]);
}
}
More about templates and template languages here.
Last modified 6mo ago