How can I set some parameters on my HTTPS functions in Firebase?
I am building an app, and while building the app, I have managed to grow my mailing list. Now I want to send mails out, but I want to make sure that they can unsubscribe before I send anything out.
I am using Firebase for everything, and I have managed to make a function that sends mails out to every subscribed mail.
I am also able to "unsubscribe" a specific mail, but that is hardcoded, and not at all an optimal solution.
exports.testUnsub = functions.https.onRequest((req, res) => {
var db = admin.database();
var ref = db.ref("mailingList/-KhBOisltrOmv57Mrzus");
ref.child("subscribed").set(false);
console.log("-KhBOisltrOmv57Mrzus has unsubscribed from mailing list.");
});
In the mail I send there is an URL, which triggers this HTTPS function. I want to set a parameter on that URL so it becomes dynamic. Something like:
https://us-central1-<project-id>.cloudfunctions.net/testUnsub?listID=xxxxxxxxxxx
I am looking for anything that can get me on the right direction.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…