Skip to main content

Newsletter Provider

To add a new newsletter provider head over to

src/services/newsletter/providers

create a new provider with the name [provider].service.ts

Inside the file add the following code:

import { NewsletterInterface } from "@github20k/services/newsletter/newsletter.interface";
import { AbstractServicesService } from "@github20k/services/abstract.services.service";
import { object, string } from "yup";

export class ProviderService extends AbstractServicesService implements NewsletterInterface {
// required environment variables
validation = object({
PARAM: string().required(),
PARAM: string().required(),
});

providerName = "provider name";

async registerToNewsletter(name: string, email_address: string) {
// register to the newsletter with name and email
}
}

Make sure to add the new provider name also in env.check.ts