This isn't perfect because it doesn't handle the case where a previous build hasn't finished yet. But at least it won't send mail for old builds that fail while a newer build has already succeeded.
VPKMUFF3FHXEYFLWXYYXGGSCRKMO5TQNXE2ZGGT3YKBQ5HQPHVYAC