I'm going to use Symfony2 to sent periodically a newsletter to many users. I've to include a permalink to the HTML email for those who experience problems in reading them with an email client.
Anyway, assuming that i'm sending the newsletter this way:
// Assume success and create a new SentMessage to store and get permalink
$sent = new SentMessage();
$sent->setRecipients(/* ... */);
$sent->setSubject(/* ... */);
$sent->setContent(/* ... */);
// Get the slug for the new sent message
$slug = $sent->getSlug(); // Like latest-product-offers-546343
// Construct the full URL
// e.g. http://mydomain.com/newsletter/view/latest-product-offers-546343
// Actually send a new email
$mailer->send(/* .. */);
How can i construct the full URL (domain + controller + action + slug) to include it in a new email?