Emails API

Overview of emails API methods

post
Send Email

https://api.codemash.io/:version/notifications/email
Send an email message.
Request
Response
Request
Path Parameters
version
required
string
A version of API endpoint.
Headers
Authorization
required
string
Secret API key which belongs to your project or user. Not required if using cookies with session ID.
x-cm-projectid
required
string
Your project's ID. Can be passed as query parameter.
Body Parameters
templateId
required
string
ID of email template to use.
cultureCode
optional
string
Language code. If you have more than one language set in your project you can use this parameter to specify which language template to use.
forceRequestLanguage
optional
string
If recipient user has a language set, user language is used to select a template language. This forces to use cultureCode parameter instead of user's language.
roles
optional
array
Roles of users to be set as recipients.
emails
optional
array
Array of emails to be set as recipients.
users
optional
array
Array of user IDs to be set as recipients.
ccEmails
optional
array
Array of emails to be set as CC recipients.
ccUsers
optional
array
Array of user IDs to be set as CC recipients.
bccEmails
optional
array
Array of emails to be set as BCC recipients.
bccUsers
optional
array
Array of user IDs to be set as BCC recipients.
tokens
optional
object
Key value pair (string: string) object of custom tokens.
postpone
optional
integer
Amount of milliseconds to postpone sending the email.
respectTimeZone
optional
boolean
If creating a postponed email and recipient of an email has timezone set, then postpones according to recipients timezone.
Response
200: OK
Returns true if request was successfully processed.
{
"result": true
}
.NET
Node
.NET
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" }
});
Node

More about templates and template languages here.