Welcome Guest, Not a member yet? Register   Sign In
How to send an html email with dynamic data
#1

Newbie here, needing help!
I am scratching my head - I want to send an email with html formatted page. With CI3 you could send an email with
PHP Code:
 
[code]$this->email->message($this->load->view('new_user',$datatrue));[/code]
But how can I achieve this with CI
Reply
#2

(This post was last modified: 10-08-2021, 12:20 AM by InsiteFX.)

Try this.

PHP Code:
$this->setMessage(view('new_user',$data)); 

Lets us know how you make out.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

$isSent = $this->email
->setTo($entity->email)
->setSubject(lang('Auth.activationSubject'))
->setMessage(view($this->authConfig->views['emailActivation'],
['hash' => $entity->toArray()['activate_hash']]))
->setMailType('html')->send();
Enlightenment  Is  Freedom
Reply




Theme © iAndrew 2016 - Forum software by © MyBB