Ghost/ghost/api-version-compatibility-service/lib/api-version-compatibility-service.js
Naz a8333f22d8 Added bare bones functionality sending an email
refs https://github.com/TryGhost/Toolbox/issues/292

- Super happy path scenario which handles sending information with some basic incompatibility information
- It's meant to be built up upon! More to follow :)
2022-04-21 15:57:43 +08:00

17 lines
450 B
JavaScript

class APIVersionCompatibilityService {
constructor({sendEmail}) {
this.sendEmail = sendEmail;
}
handleMismatch({acceptVersion, contentVersion, userAgent}) {
const emailTemplate = `
${userAgent} integration expected Ghost version: ${acceptVersion}
Current Ghost version: ${contentVersion}
`;
this.sendEmail(emailTemplate);
}
}
module.exports = APIVersionCompatibilityService;