Combine client portal- and payment link

Version v5.12.8 - Environment Docker

id like to send customers a payment-link (subscription), but I want that the customer is also straight logged in, so he doesn’t need to manually login with email/pw.

I tried to use the key_login instead of magic_link but that doesn’t seem to work as the ?redirect= won’t work.

Here is my approach but

  1. I don’t know how to generate the magic token
  2. I’d rather have it like the client portal link without expiration

https://domain.tld/client/magic_link/{CLIENT_MAGIC_TOKEN}?redirect=https%3A%2F%2Fdomain.tld%2Fclient%2Fsubscriptions%2{SUBSCRIPTION_ID}%2Fpurchase%3Fcoupon%3D

perviously I just used recurring invoices but subscription (payment link) is what fits my use case better.

is there a solution for my scenario?

Hi,

This is the link we use for the WordPress plugin.

https://domain.com/client/key_login/{$contact->contact_key}?client_hash='{$client->client_hash}

correct, that is the regular client portal link you find in invoiceninja “clients → mr x. → Contacts”. This link works as a login without a password.
But how:

  • a. do I forward a customer to a payment link after login (and without sending hin 2 links he needs to click after each other) https://domain/client/subscriptions/VolejRejNm/purchase or
  • b extend the purchase/paymant link so the login will happen automatically through key_login?

a. Maybe you can use the API to set a custom message in the client portal which includes the link
b. I’m not sure if that’s supported, I suggest asking in a disucssion on GitHub.

1 Like