zarpio
zarpio

Reputation: 7348

Using Email Class in Codeigniter (Advanced Way)

I want to send emails using Email Class(CodeIgniter) Problem is that Email is sending so simple in text format... I want to design email with (html, tables and colors) or What is the advanced-way for Emailing with CodeIgniter.

Upvotes: 0

Views: 3535

Answers (1)

zarpio
zarpio

Reputation: 7348

function signup(){

    #stripped out the validation code

    #stripped out the db insert code

    $data = array(
    'some_var_for_view'=>'Some Value for View'
    );

    $htmlMessage =  $this->parser->parse('user/email/signup_html', $data, true);
    $txtMessage = $this->parser->parse('user/email/signup_txt',  $data, true);

    #send the message
    $this->email->from('[email protected]', 'CSSNinja');
    $this->email->to($this->input->post('email_address'));
    $this->email->subject('Account Registration Confirmation');
    $this->email->message($htmlMessage);
    $this->email->alt_message($txtMessage);
    $this->email->send();

}

My problem is now solved with this code found from link below

http://www.webdevkungfu.com/email-templates-with-codeigniter/

Upvotes: 3

Related Questions