I have multiple cloud functions that use a single value, basically something like this:
index.js
function emailFooter() {
return `<div>email footer</div>`;
}
exports.sendEmailSuccess = functions.https.onCall(() => {
const emailContent = 'success content' + emailFooter();
sendEmail(emailContent) // fake email sender
});
exports.sendEmailFailure = functions.https.onCall(() => {
const emailContent = 'failure content' + emailFooter();
sendEmail(emailContent) // fake email sender
});
The problem is that I want to change the footer content (returned by emailFooter
), but in order to do so (as far as I've researched) I first have to change it in the code and then deploy every single cloud function that uses emailFooter
(sendEmailSuccess
and sendEmailFailure
), so the footer will look the same on each type of email.
Of course, I could just deploy all the functions at the same time with firebase deploy --only functions
, but we used to be multiple developers and some of us updated functions to the point we don't know which ones are the same in index.js as in GCP (about 20 functions) and I'd have to check each one so I wouldn't deploy an old version.
Is there a way to update this single value or at least know which functions are up to date?
Thanks.