ThisGuyHasTwoThumbs ThisGuyHasTwoThumbs - 1 year ago 74
PHP Question

Call php function from email

I have a function:

public function doSomething($uniqueID)
$model = new model();


all it does is update a field in the database. But I'm struggling with it.
What the process of the function is, it'll create a row in the database and send an email asking to approve / decline.

I need it so, when user clicks approve / decline it goes to the doSomething function passing the ID. The href looks like "http://localhost/doSomething/uniqueID" but it fails - currently returns the view file wasn't found for it.

How can I exec a function from html email link?

Answer Source

answer was simple :)

because the url in the email was /controller/action?param=val it wasn't being pulled in. Doing /controller/action/val is the same as doing $fn->function($param) :) hope this makes sense

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download