a8333f22d8
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 :)
17 lines
450 B
JavaScript
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;
|