This isnt a great idea due to security concerns, but here is a solution:
When sending and email generate som random string token token, save it in your DB along with user id.
In email send link, maybe something like : mypage.com/login?token=GENERATED_TOKEN
When receiving this POST request, search through database looking for that specific token. If match is found, go ahead and log in user which this token belongs to.
How to generate such token: best practice to generate random token for forgot password
note: this aproach is viable when generating links for things like password reset links to verify user that are single use (deleted / marked after one use) and are time-limited (for example links works only 6 hours after being send).
Please do not use this for regurarly logging in users