-
Notifications
You must be signed in to change notification settings - Fork 4
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: '<[email protected]>',
body: { from: '[email protected]', to: [ '[email protected]' ] },
statusCode: 202,
statusMessage: '250 2.0.0 Ok: queued as 4F6wl33N22zlh8T2',
}ℹ️ Regarding the provider, some properties can be null.