CodeIgniter Forums
Inserting variable in an email? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Inserting variable in an email? (/showthread.php?tid=35004)



Inserting variable in an email? - El Forum - 10-16-2010

[eluser]anna16[/eluser]
Hello guys

I'm trying to insert a variable inside an email.

Is this correct?
Code:
$total = 50;

$this->email->message('Amount: $total');

I tried it but it doesn't worked.
what is the proper way?

Thanks in advanced?


Inserting variable in an email? - El Forum - 10-16-2010

[eluser]Siddhesh[/eluser]
Code:
$total = 50;

$this->email->message('Amount: $total');

Use

Code:
this->email->message("Amount: $total");

It will work as variable substitution is not allowed for the string in single quote.