Issues with Public invoices on Self Hosted v3.1.1

I just upgraded to v3.1.1. I added a test client and created an invoice so that I could test the emails that it sends out and to verify that I could process a payment with my Stripe account.

The link that was sent in the email was broken. I was able to fix the link by commenting out some code in the getLink() method in app/Models/Invitation.php file as follows:

if ($iframe_url && ! $forceOnsite) {
return “{$iframe_url}?{$this->invitation_key}”;
} elseif ($this->account->subdomain) {
$url = $url;
//$url = Utils::replaceSubdomain($url, $account->subdomain);

}

That adjustment corrected the link to https://ninja.cajunpepper.com/view/Y4uOKBovsYTIje6quVZRDSQ4i9yqMI36, but now when I follow the link I get the following error:

Something went wrong…
The requested invoice is not available

If you’d like help please email us at AKIAIBOSTCIZJ6UMCXDA

I’m hoping to get this resolved quickly as it is important that I be able to have my clients pay me with their credit cards.

Thanks in advance!

If you’re self hosting you shouldn’t need to use the subdomain setting (we’ll look into hiding it).

Instead, make sure the APP_URL is set correctly in the .env file.

Thanks, Hillel!

I checked the .env file and APP_URL is set appropriately. The modification that I made to app/Models/Invitation.php got the email to include the appropriate url. Any ideas on why that URL is giving me the “Something went wrong…The requested invoice is not available”? Any help on figuring that out without me having to trace through the code and database is greatly appreciated!

Thanks again!

Not sure, maybe the client or invoice is deleted?

Thanks for the quick reply!

The client and invoice are still in the system.
Client Invoice in Admin area

I can get to the client Dashboard just fine.
Client's dashboard

I get the error when I try view the actual invoice as the client. Can you at least tell me what the hash in the invoice url relates to in the DB so I can verify that it does actually exist in the DB? Also, you’ll notice that I’ve blurred some text out where it says “If you’d like help please email us at”. It is adding my Amazon SES Username name there instead of the contact email address. I imagine there is a bug somewhere that is printing MAIL_USERNAME instead of MAIL_FROM_ADDRESS.
Error when viewing the invoice

Here’s a SQL query to check:

select i.id, c.email from invitations i left join contacts c on c.id = i.contact_id where i.invitation_key = ''

Have you manually deleted any data from your database?

Try adding CONTACT_EMAIL=… to the .env file to fix the email address.

I have not manually deleted any data from the database.

The query brought back a single result with the correct id and email address. Is this possibly an issue where the system was supposed to send an invitation email to the client to verify their contact email address, and that didn’t happen, or do “invitations” refer only to an individual invoice?

Also, adding CONTACT_EMAIL to the .env file did not fix the email address issue. Not extremely concerned with this issue right now.

If you have still have a value set for the subdomain setting can you try removing it.

Each contact per/invoice has an invitation, it’s created along with the invoice whether or not it’s sent.

Thanks so much for your help! Changing the subdomain setting to website and adding my base url got it working. Apologies for not checking that earlier. I misunderstood your original response, and thought that there wasn’t a setting to turn subdomain off. It is under Settings -> Advanced Settings -> Client Portal for anyone else that has this issue.

Great to hear, we’ll fix the CONTACT_EMAIL in our next release.