Skip to main content

Cerb4 adding Images / html to outbound emails in 4.3+

Cerb4 use swiftmailer to send emails. The files to change is api/app/Mail.php

For 4.1.x or 4.2.x check out http://middleswarth.net/content/cerb4-adding-images-html-outbound-emails .

More documentation is available at:

http://swiftmailer.org/docs/introduction

Code snippet for finding group ID info.

$ticket_id = $message->ticket_id;
$ticket = DAO_Ticket::getTicket($ticket_id);

and then $ticket->team_id is the Group id.

// #### Inserted in there to add html part.
$answernet_body = ''.$message->body.'';  //<-  This is were you insert your custom HTML.
$email->addPart(nl2br($answernet_body), 'text/html');

or
$mail->addPart(nl2br($answernet_body), 'text/html');

Were to add code to add additional template items. It needs inserted in 3 places.

after

$email->setBody($content);

or
$mail->setBody($content);

at Aprox line 200, 615, and 840.

Thanks
Robert

Thanks very much for trying

Thanks very much for trying to help with this. I do however find your explanation for such a simple process very confusing to follow. It would be more helpful if it was clearly explained

Yea I need to clean this up a lot.

Yea I need to clean this up a lot. These were rough notes I wrote to list what was needed. I need to clean these up and rewrite.

Thanks
Robert