I have service which is not invoked by user request, but by task. Now I need to send email from this task, and email contains link to my web application, how can I get full url of my application so that my email can link back to my web application?
Example of service:
@Service
public class MyService {
@Scheduled(cron="0 */10 * * * *")
@Transactional
public void myTask() throws IOException, ParseException
{
// Now I have to send email with my app url, but how can I get it here ?
}
}