相关疑难解决方法(0)

如何将完整的URL添加到Symfony2发送的简报中?

我将使用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(/* .. */);
Run Code Online (Sandbox Code Playgroud)

如何构建完整的URL(域+控制器+动作+ slug)以将其包含在新电子邮件中?

url permalinks swiftmailer symfony

20
推荐指数
3
解决办法
1万
查看次数

标签 统计

permalinks ×1

swiftmailer ×1

symfony ×1

url ×1