本文整理汇总了PHP中Pimcore\Model\Object\Concrete::getProperty方法的典型用法代码示例。如果您正苦于以下问题:PHP Concrete::getProperty方法的具体用法?PHP Concrete::getProperty怎么用?PHP Concrete::getProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pimcore\Model\Object\Concrete
的用法示例。
在下文中一共展示了Concrete::getProperty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendMail
/**
* @param Model\Tool\Newsletter\Config $newsletter
* @param Object\Concrete $object
*/
public static function sendMail($newsletter, $object, $emailAddress = null, $hostUrl = null)
{
$params = ["gender" => $object->getGender(), 'firstname' => $object->getFirstname(), 'lastname' => $object->getLastname(), "email" => $object->getEmail(), 'token' => $object->getProperty("token"), "object" => $object];
$mail = new Mail();
$mail->setIgnoreDebugMode(true);
if (\Pimcore\Config::getSystemConfig()->newsletter->usespecific) {
$mail->init("newsletter");
}
if (!Tool::getHostUrl() && $hostUrl) {
$mail->setHostUrl($hostUrl);
}
if ($emailAddress) {
$mail->addTo($emailAddress);
} else {
$mail->addTo($object->getEmail());
}
$mail->setDocument(Document::getById($newsletter->getDocument()));
$mail->setParams($params);
// render the document and rewrite the links (if analytics is enabled)
if ($newsletter->getGoogleAnalytics()) {
if ($content = $mail->getBodyHtmlRendered()) {
include_once "simple_html_dom.php";
$html = str_get_html($content);
if ($html) {
$links = $html->find("a");
foreach ($links as $link) {
if (preg_match("/^(mailto)/", trim(strtolower($link->href)))) {
continue;
}
$glue = "?";
if (strpos($link->href, "?")) {
$glue = "&";
}
$link->href = $link->href . $glue . "utm_source=Newsletter&utm_medium=Email&utm_campaign=" . $newsletter->getName();
}
$content = $html->save();
$html->clear();
unset($html);
}
$mail->setBodyHtml($content);
}
}
$mail->send();
}