⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Call for sending mail from field Email ...



Jeff
  • profile picture
  • Member

Posted 18 January 2014 - 20:38 PM

Hello, 
 
Grocery-crud is a great toolbox. 
 
I want to know how to automatically send an email to the "Email" field of the documentation "Employees Example" both from the table since the publication of the record ; like "mailto:". 
 
Thank you.

 


Jeff
  • profile picture
  • Member

Posted 18 January 2014 - 20:59 PM

I found, though it might be useful to someone...

 

function employees_management()
{
    $crud = new grocery_CRUD();
 
    $crud->set_theme('datatables');
    $crud->set_table('employees');
    $crud->set_relation('officeCode','offices','city');
    $crud->display_as('officeCode','Office City');
    $crud->set_subject('Employee');
   
    $crud->callback_column('Email',array($this,'mailto'));
 

    $output = $crud->render();

 
    $this->_example_output($output);
}
 

 

public function mailto($value, $row)
{
return '<a href="mailto:' . $value . '">' . $value . '</a>';
}