Clement Opeoluwa Adetunji Clement Opeoluwa Adetunji - 5 months ago 16
PHP Question

I want to insert a link in an email in cakephp

i want to send a mail to users, the mail is sending , but the link in it is now showing as a link, I also want to embed a logo in the mail but the logo is not showing, below is my code. I am using cake 2.8

$Email = new CakeEmail();
$Email->from(array('admin@wacscoac.org'=>'West Africal College of Surgeons'));
$Email->to($email);
$Email->subject('Reviewer Invitation From West African College of Surgeons');
$Email->send('Dear Reviewer, You have been invited by the Head of Faculty of $faculty from the West'
. 'African College of Surgeons to register as a reviewer. Please click on the link '
. 'below to register'
. 'http://wacscoac.org/edms/users/addreviewer');
$Email->attachments('img/logo.png');

Answer
$link = '<a href="http://wacscoac.org/edms/users/addreviewer"'>
             <img src="img/logo.png" alt="">
        </a>';

and then

$Email->send('Dear Reviewer, You have been invited by the Head of aculty  of $faculty from the West'  
           . 'African College of Surgeons to register as a reviewer. Please click on the link '
           . 'below to register'
           . $link);
Comments