Set up email
About three minutes, once. Afterwards, bank and e-wallet emails turn into transactions for you to confirm. Budget only receives the emails your filter forwards; the rest of your Gmail stays private.
About three minutes, once. Afterwards, bank and e-wallet emails turn into transactions for you to confirm. Budget only receives the emails your filter forwards; the rest of your Gmail stays private.
Open Gmail's forwarding settings, choose Add a forwarding address, and paste this:
u_uiz5ia7nyd@in.example.comThe button opens the first Google account signed in on this browser. If that's not the mailbox your bank emails go to, switch accounts from the profile picture in Gmail first. Gmail's app doesn't have these settings; use a computer, or gmail.com with Desktop site switched on.
Some Gmail accounts don't offer it. Use this small script instead: it runs in your own Google account every 10 minutes and forwards only emails from your banks to Budget. Then skip the other steps on this page.
// Budget: forwards bank and e-wallet emails from this Gmail to your Budget address.
// Only emails from the senders below are forwarded; nothing else is read or sent.
// Setup: paste this at script.google.com (New project), click Run with "setup" selected, and allow access.
const BUDGET_ADDRESS = "u_uiz5ia7nyd@in.example.com";
const BANK_SENDERS = ["atome.ph","bpi.com.ph","eastwestbanker.com","gcash.com","monee.com.ph"];
const LABEL = "Sent to Budget";
function setup() {
ScriptApp.getProjectTriggers().forEach((t) => ScriptApp.deleteTrigger(t));
ScriptApp.newTrigger("forwardBankEmails").timeBased().everyMinutes(10).create();
// First run covers the last 2 days, so recent bank emails show up in Review right away.
PropertiesService.getScriptProperties().setProperty("lastRun", String(Date.now() - 2 * 24 * 60 * 60 * 1000));
forwardBankEmails();
}
function forwardBankEmails() {
const props = PropertiesService.getScriptProperties();
const since = Number(props.getProperty("lastRun") || Date.now() - 60 * 60 * 1000);
const startedAt = Date.now();
const label = GmailApp.getUserLabelByName(LABEL) || GmailApp.createLabel(LABEL);
const query = "from:(" + BANK_SENDERS.join(" OR ") + ") after:" + Math.floor(since / 1000 - 600);
for (const thread of GmailApp.search(query, 0, 100)) {
let forwarded = false;
for (const message of thread.getMessages()) {
if (message.getDate().getTime() <= since) continue;
const from = message.getFrom().toLowerCase();
if (!BANK_SENDERS.some((domain) => from.includes("@" + domain) || from.includes("." + domain))) continue;
forwardToBudget(message);
forwarded = true;
}
if (forwarded) thread.addLabel(label);
}
props.setProperty("lastRun", String(startedAt));
}
// Same layout as Gmail's own Forward, so Budget can tell which bank the email came from.
function forwardToBudget(message) {
const header = [
"---------- Forwarded message ---------",
"From: " + message.getFrom(),
"Date: " + Utilities.formatDate(message.getDate(), "UTC", "EEE, d MMM yyyy HH:mm:ss Z"),
"Subject: " + message.getSubject(),
"To: " + message.getTo(),
];
const escape = (s) => s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
GmailApp.sendEmail(BUDGET_ADDRESS, "Fwd: " + message.getSubject(), header.join("\n") + "\n\n" + message.getPlainBody(), {
htmlBody: "<div>" + header.map(escape).join("<br>") + "</div><br>" + message.getBody(),
});
}
Waiting for Gmail. Its confirmation appears here by itself a few seconds after you add the address.
After verifying, leave Disable forwarding selected. Don't choose Forward a copy of incoming mail: that would send all your email. The filter in the next step forwards only bank emails.
This filter forwards emails from these senders only: Atome, BPI, EastWest, GCash, SPayLater.
Download your filterWaiting. The next time your bank emails you, it shows up here and in Review.