I must send mails to different users with different messages depending on specific parameters. Currently I have the text to send, parameterized in hard, that is, in this way as an example:
$nombre = $usuario->__GET('Nombre');
$email = $usuario->__GET('Email');
$informacion= $reportes->__GET('Reporte');
$texto = "Estimado ".$nombre.", este correo es para informarle qué ".$informacion.";
enviar_mail($nombre ,$email, $texto );
What I want is that the text is not written in the code but in the database with the same parameters (since there are many different ones and they vary over time) to be able to have this type of script:
$nombre = $usuario->__GET('Nombre');
$email = $usuario->__GET('Email ');
$informacion = $reportes->__GET('Reporte');
$texto = $reportes->__GET('Texto');
enviar_mail($nombre ,$email, $texto );
But the text that appears in the parameter $texto
appears with the parameters as a string.
"Estimado ".$nombre.", este correo es para informarle qué ".$informacion.";
I have tried to store it in the database in the following ways:
- "Dear ".$name.", This email is to let you know what ".$information."
- Dear ".$name.", this email is to inform you what ".$information.
- Dear $name, this email is to inform you what $information
I don't know if it's not possible or I'm very lost on how to do this.
Cheers