Repository navigation
Email response
Steve Lebleu edited this page Feb 23, 2024
·
4 revisions
This section describe the email response format.
If your .cliamrc.js contains some errors, the process is exited with code 0 and explicit error message:
> Error in .cliamrc.js: "consumer.name" is not allowedReturned error have always the same format, regardless used mode or provider:
{
statusCode: Number,
statusText: String,
errors: String[]
}{
statusCode: 400,
statusText: 'Validation error',
errors: [ '"meta.to[0].email" must be a valid email' ]
}{
statusCode: 403,
statusText: 'Forbidden.',
errors: [ '' ]
}Returned success response has always the same format, regardless used mode or provider:
{
mode: 'api',
provider: 'sendgrid',
server: 'apache',
uri: 'https://www.provider.com/send/email',
timestamp: 213456854,
headers: {},
messageId: '<2e89cb3a-9b82-6dc3-9b08-485050d3a2ac@example.com>',
body: { from: 'george.moe@example.com', to: [ 'john.doe@example.com' ] },
statusCode: 202,
statusMessage: '250 2.0.0 Ok: queued as 4F6wl33N22zlh8T2',
}âđïļ Regarding the provider, some properties can be null.