Symfony2を使用して、定期的にニュースレターを多くのユーザーに送信します。電子メールクライアントでの読み取りで問題が発生した場合に備えて、HTML電子メールへのパーマリンクを含める必要があります。
とにかく、私がこの方法でニュースレターを送信していると仮定すると:
// 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(/* .. */);
完全なURL(ドメイン+コントローラー+アクション+スラグ)を作成して、新しい電子メールに含めるにはどうすればよいですか?