Creating direct links to Typo3 backend modules from email notifications

I’m working on a feature where administrators receive email notifications about new orders. The email should contain clickable links that take them directly to my custom backend module where they can approve or decline these orders.

I’ve already built the backend module that handles the order management functionality. However, I’m running into an issue where clicking the email link redirects users to the main backend dashboard instead of my specific module.

The workflow should be:

  1. Admin receives email notification
  2. Clicks link in email
  3. Gets taken directly to the order management module (after authentication)
  4. Can immediately approve or reject the order

Right now step 3 is failing and users end up on the backend home screen. How can I construct the email links to properly route to my custom module?

Interesting issue! What TYPO3 version are you using? Are you generating those backend URLs from within the backend or from a command/scheduler task? The context can really mess up URL generation. Have you tried logging the actual URLs before sending them to see what they look like?

yep! totally faced that too! just double check the token and route params for the URL. using BackendUtility::getModuleUrl() is key, and don’t forget to include all the important args like the order ID. that should do the trick!

This happens because of authentication state issues and how your routes are built. When users click the email link, they get sent to the login page first, which just dumps them on the dashboard after login instead of taking them where they actually wanted to go. Here’s how to fix it: Build your email URLs using the full backend route path with the module identifier. Make sure you’re including the module route and any parameters you need (like order IDs). The trick is getting the auth flow to remember where the user was originally trying to go. I ran into this exact same thing on another project. Adding the right route parameters and making sure the module was properly registered in the routing config fixed the redirect problem. Before you send any emails, test the URLs directly in your browser while logged in to make sure they actually work.