Friday, December 6, 2013

Sending Email to Selected Customer

Currently I have this code in my customers/index.ctp

<td>  <?php echo $this->Form->checkbox('Customers.'.$customer['Customer']['id'], array('value' => $customer['Customer']['id'], 'hiddenField' => false)); ?></td>

which created the checkbox in the table.

Now I would like to know how to write email function in controller. I have been looking for how to do it using foreach but I haven't found exactly what I am looking for. However, I found some similar code which delete the selected customer. It is like this

public function deleteSelected()  {      foreach($this->request->data['Customers'] as $key => $value)      {         $this->Customers->delete($key);      }      $this->redirect($this->referer());  }

Now I am wondering if I can change the above code so that it will send email to customer not deleting the customer from table.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: