ThisGuyHasTwoThumbs ThisGuyHasTwoThumbs - 4 months ago 23
PHP Question

Call php function from email

I have a function:

public function doSomething($uniqueID)
{
$model = new model();
$model->someFunction($uniqueID);

$this->goSomewhere();
}


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