Print rendered subject in archive

[MAILPOET-826]
This commit is contained in:
Pavel Dohnal
2017-06-20 10:50:57 +01:00
parent 5600d8087f
commit fb059f585e
2 changed files with 2 additions and 2 deletions

View File

@ -89,7 +89,6 @@ class Shortcodes {
if(!empty($title)) { if(!empty($title)) {
$html .= '<h3 class="mailpoet_archive_title">'.$title.'</h3>'; $html .= '<h3 class="mailpoet_archive_title">'.$title.'</h3>';
} }
$html .= '<ul class="mailpoet_archive">'; $html .= '<ul class="mailpoet_archive">';
foreach($newsletters as $newsletter) { foreach($newsletters as $newsletter) {
$queue = $newsletter->queue()->findOne(); $queue = $newsletter->queue()->findOne();
@ -123,7 +122,7 @@ class Shortcodes {
); );
return '<a href="'.esc_attr($preview_url).'" target="_blank" title="' return '<a href="'.esc_attr($preview_url).'" target="_blank" title="'
.esc_attr(__('Preview in a new tab', 'mailpoet')).'">' .esc_attr(__('Preview in a new tab', 'mailpoet')).'">'
.esc_attr($newsletter->subject). .esc_attr($newsletter->newsletter_rendered_subject).
'</a>'; '</a>';
} }
} }

View File

@ -860,6 +860,7 @@ class Newsletter extends Model {
static function getArchives($segment_ids = array()) { static function getArchives($segment_ids = array()) {
$orm = self::table_alias('newsletters') $orm = self::table_alias('newsletters')
->distinct()->select('newsletters.*') ->distinct()->select('newsletters.*')
->select('newsletter_rendered_subject')
->whereIn('newsletters.type', array( ->whereIn('newsletters.type', array(
self::TYPE_STANDARD, self::TYPE_STANDARD,
self::TYPE_NOTIFICATION_HISTORY self::TYPE_NOTIFICATION_HISTORY