I am writing a newsletter system for my client. They write the email body with CKEditor and I want to embed all images they give in the editor.
It forwards the content of the email in a variable, named content
.
public function send ( $newsletter, $subscriber, $time = 0 )
{
$template = 'emails.templates.' . $newsletter->template;
Mail::later($time, $template,
[
'content' => $newsletter->content
],
function ($message) use ($newsletter, $subscriber) {
$message->subject($newsletter->subject);
$message->from('newsletter@example.com', 'Example Newsletter');
$message->to($subscriber->email, $subscriber->fullname);
foreach ( $newsletter->attachments AS $attachment ) {
$path = public_path($attachment->path);
$message->attach($path);
}
});
return Redirect::back()->with('success', true);
}
I've seen that of course (even if I'm using Laravel 4.2), but the problem here is I get something like below and I want to process all imgs to be embedded.
<p>This is the first newsletter for you!</p>
<img src="/uploads/first.png" />
<p> Blabla... </p>
The thread is a bit old, but I am currently facing the same problem. How did you manage to embed the images?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community