Hi All. I'm having trouble getting my head around a mechanism for sending an email invite (from within my basic Biff app) to a prospective user which needs to contain a custom ID for context. I've managed to have the email (containing a mailersend URI) sent out, but I'm not sure how to propagate my ID, so that it's in the request when the user clicks the link. Is this possibly a question for the mailersend API forum? 🙂 I hope that makes sense.
Thanks Jacob! I think what was confusing me was that I was trying to re-purpose the send-link functionality and was seeing links like..
...
..in the emails. My assumption was that the app-specific URI was encoded in the JWT and mailersend would return a redirect to it. I gather this is a click-tracking tool, which I don't need. I was attempting to piggyback the ID onto the mailersend URI! 😬
If I understand you correctly, I can simply use an app-specific URI in the email as you describe.ah got it--yeah that's just mailersend adding a redirect url for click tracking. you can disable it in your mailersend account if you want. > If I understand you correctly, I can simply use an app-specific URI in the email as you describe. > yep!
On second thoughts, I suppose I could simply create a corresponding database "invite" entry (keyed by email address) for the invite which would be "resolved" when the invite link is clicked. Please forgive the "thinking out loud" episode. I'm still trying to get my bearings with Biff and front-end work in general. Maybe I'm expecting too much of HTTP and/or the mailersend API. 🤔
No worries!
When you create the URL you can put an ID inside the path params, like . (I would use path params instead of query params because sometimes the latter get screwed up by email clients). If you need to ensure that the URL hasn't been tampered with, you can create a signed/encrypted JWT that contains the ID, then put that in the URL. This is what the authentication module does: https://github.com/jacobobryant/biff/blob/94eb24d96b0592399f264e1ee2ffeab186f46c78/src/com/biffweb/impl/auth.clj#L31