function splitPreheader(data) {
    // Remove the preheader span from the email using cheerio
    const $ = cheerio.load(data.html);
    const preheader = $('.preheader');
    // @ts-ignore
    data.preheader = preheader.html();
    preheader.remove();
    data.html = $.html();
}
Remove the preheader span from the email html and put it in a separate field called preheader
@template {{html: string}} T
@param {T} data
@returns {asserts data is T & {preheader: string}}