Welcome Guest, Not a member yet? Register   Sign In
send message to all email adresses of a table in a view
#2

[eluser]j0se[/eluser]
IMHO I do all in one task:

In the view:
Code:
<?php echo form_open('sektionssprecher/sendemail')?>
<table >
  <thead>
   <tr>
    <th>Benutzername</th>
    <th>Vorname</th>
    <th>Nachname</th>
    <th width="200"> Email</th>
   </tr>
  </thead>
  <tbody>
   &lt;?php foreach ($users as $member): ?&gt;
    <tr>
     <td>&lt;?php echo $member->display_name ?&gt;</td>
   <td>&lt;?php echo $member->first_name ?&gt;</td>
  <td>&lt;?php echo $member->last_name ?&gt;</td>
     <td>&lt;?php echo mailto($member->email) ?&gt;</td>
    </tr>
   &lt;?php endforeach; ?&gt;
  </tbody>
</table>
&lt;?php echo form_textarea();?&gt;
&lt;?php echo form_button('sendemail','send message to all'); ?&gt;
&lt;?php echo form_close() ?&gt;


In controller:


Code:
foreach ($users as $member):

$this->email->from('[email protected]', 'Your Name');
$this->email->to($member->email);
$this->email->subject('SUBJECT YOU CAN PASS IT FROM INPUT TEXT ');
$this->email->message($this->input->post('TEXTAREA VALUE');
$this->email->send();

endforeach;


Messages In This Thread
send message to all email adresses of a table in a view - by El Forum - 05-15-2013, 02:25 AM
send message to all email adresses of a table in a view - by El Forum - 05-15-2013, 05:04 AM
send message to all email adresses of a table in a view - by El Forum - 05-15-2013, 10:22 AM
send message to all email adresses of a table in a view - by El Forum - 05-16-2013, 01:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB