Welcome Guest, Not a member yet? Register   Sign In
appending array of data to the message parameter of send_email()
#2

[eluser]zac[/eluser]
You need to build your message separately, then pass it in to send_email(). Something like this:

Code:
if($_POST) {
    $data['volunteers'] = $this->data_model->sendChairVolunteerList();

    $msg = "This is the list of volunteers:\n\n";
    $msg .= implode(", ",$data['volunteers']); // convert array to a comma-separated list

    send_email('[email protected]', 'List of Volunteers', $msg);
    $this->load->view('email-sent-view', $data);
} ...

Or if building your message directly in the function is too awkward, use a view as a template. Setting the third argument to 'true' returns the parsed view instead of rendering it:

Code:
$msg = $this->load->view('email-message',$data,true);

send_email('[email protected]', 'List of Volunteers', $msg);


Messages In This Thread
appending array of data to the message parameter of send_email() - by El Forum - 11-12-2010, 03:25 PM



Theme © iAndrew 2016 - Forum software by © MyBB