import previewEmail from "preview-email" ; type ResetPasswordMailer = { to : string ; token : string ; } ; export function forgotPasswordMailer ( { to , token } ) { const origin = process . env . APP_ORIGIN || process . env . BLITZ_DEV_SERVER_ORIGIN ; const resetUrl = `${ origin }/reset-password?token=${ token }` ; const msg = { from : "TODO@example.com" , to , subject : "Your Password Reset Instructions" , html : `
      <h1>Reset Your Password</h1>
      <h3>NOTE: You must set up a production email integration in mailers/forgotPasswordMailer.ts</h3>

      <a href="${ resetUrl }">
        Click here to set a new password
      </a>
    ` , } ; return { async send ( ) { if ( process . env . NODE_ENV === "production" ) { throw new Error ( "No production email implementation in mailers/forgotPasswordMailer" ) ; } else { await previewEmail ( msg ) ; } } , } ; }