0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-13 21:30:30 -05:00
logto/packages/connector-sendgrid-mail/src/mock.ts
Darcy Ye b887655827
feat(connector-sendgrid-email): add sendgrid email connector (#850)
* feat(connector-sendgrid-mail): add SendGrid Mail connector

* feat(core): add SendGrid Mail connector to initializer and fix usageType
2022-05-18 11:39:36 +08:00

32 lines
882 B
TypeScript

import {
Content,
ContextType,
EmailData,
Personalization,
PublicParameters,
SendGridMailConfig,
} from './types';
const receivers: EmailData[] = [{ email: 'foo@logto.io' }];
const sender: EmailData = { email: 'noreply@logto.test.io', name: 'Logto Test' };
export const mockedParameters: PublicParameters = {
personalizations: [{ to: receivers }] as Personalization[],
from: sender,
subject: 'Test SendGrid Mail',
content: [{ type: 'text/plain', value: 'This is a test template.' }] as Content[],
};
export const mockedApiKey = 'apikey';
export const mockedConfig: SendGridMailConfig = {
apiKey: mockedApiKey,
fromEmail: 'noreply@logto.test.io',
templates: [
{
usageType: 'Test',
type: ContextType.Text,
subject: 'Logto Test Template',
content: 'This is for testing purposes only. Your passcode is {{code}}.',
},
],
};