import { airtable } from "./lib/Airtable.js";import { sendBallot } from "./lib/sendBallot.js";import { config } from "https://deno.land/x/dotenv/mod.ts";
const voters = (await airtable.get("Voters")) .map((v) => ({ name: v.fields["Name"], email: v.fields["Email"] }));
const notAbstain = (c) => c.name !== "Abstain";
const candidates = await retrieveCandidates() .filter(notAbstain);
const election = { name: config()["ELECTION_NAME"], ballotDropoffUrl: config()["ELECTION_BALLOT_DROPOFF_URL"], secretary: config()["ELECTION_SECRETARY"],};
voters.forEach((voter) => sendBallot({ election, candidates, voter }));