Welcome Guest, Not a member yet? Register   Sign In
Send newsletter to mail list, pass name intomail body.


I am making a small newsletter system. Everything works fine for now. But I want in my mail body the name from the person who is receiving the newsletter. For example

Persons in my mailinglist (john, mark , duncan). My mailinglist is saved in a database table newsletter [id, name, frontname, email].

What I want in my newsletter is for exaple :

Hello John,


This is my code for writing the body of the newsletter.

echo form_open('newsletter_controller/mailNewsletter');

echo '<input type="text" name="subject" id="subjectNewsletter" />';

echo '<textarea name="message" id="message">';
echo 'Hello this is a test newsletter </textarea>';

echo form_submit('submit', 'Send newsletter');
echo form_close();

I have this function for sending my newsletter

function mailNewsletter()
     $subject = $this->input->post('subject');
        $email = "[email protected]";
        $message = $this->input->post('message');

        $mailList = array('[email protected]', '[email protected]','[email protected]');


        $this->email->from('[email protected]', 'Sven maes');

        if ($this->email->send($message)) {

            $data['main_content'] = 'newsletter_send';

        } else {

Now how is it possible to write the names automaticly from each mailing subscriber, that are saved in the database?

Theme © iAndrew 2016 - Forum software by © MyBB