HTML tags when sending email
HTML tags when sending email
Greetings,
Whenever a user edits a record, i'm sending an email to a distribution group which shows the values. I'm trying to wrap the values in an html tag so its easier to read on the email. I tried the following but it prints the html tag instead:
Editor::inst( $db, 'parts' )
->fields(
Field::inst( 'firstname' )->validator( 'Validate::notEmpty' ),
Field::inst( 'lastname' )->validator( 'Validate::notEmpty' ),
Field::inst( 'status' ),
Field::inst( 'email' ),
Field::inst( 'company' ),
Field::inst( 'tag' ),
Field::inst( 'serialnumber' ),
Field::inst( 'requestpartnumber' ),
Field::inst( 'requestpartquantity' ),
Field::inst( 'updated_date' )
->validator( 'Validate::dateFormat', array(
'empty' => false,
'format' => 'm-d-Y g:i A'
) )
->getFormatter( 'Format::datetime', array(
'from' => 'Y-m-d H:i:s',
'to' => 'm-d-Y g:i A'
) )
->setFormatter( 'Format::datetime', array(
'from' => 'm-d-Y g:i A',
'to' => 'Y-m-d H:i:s'
) )
)
->on( 'postEdit', function ( $editor, $id, $values, $row) {
mail( me@gmail.com', 'Parts ETA', ''.implode('<br>', $values).'' );
} )
->process( $_POST )
->json();
Any idea's how to add an HTML header?
This discussion has been closed.
Answers
You'd probably have to use something more complex than PHP's built in
mail()method. ThePHPMailerclass is a popular one for example.Allan