I would like to get the url from my service class as follows:
val bookingInquiryUrl = routes.BookingController.showBookingInquiry(booking.bookingId.toString).absoluteURL()
But this leads to Cannot find any HTTP Request Header here error, and I know that this is because it does not have a rating for the request. But in my case, this is exactly what I want to do. In my application, I have a scheduled task that calls my service class, which will send an email with a URL to the showBookingInquiry page. Therefore, I have no request.
So my question is: is there any other way to generate url (without request)?
source share