Pages

Friday, November 6, 2015

How to embed a latest article view in your newsletter

  1. Create some article nodes
  2. Install views and create a view called latest_articles
  3. Activate the core module PHP filter
  4. Goto admin/newsletters/templates/mail and edit the default template (or create a new one)
  5. Choose "PHP code" as Text format and paste the following code in your template:
    <?php
    $view = views_get_view('latest_articles');
    $view->set_display('default');
    print $view->preview();
    ?>
  6. Done: goto admin/newsletters/create-send/new and send your newsletter

No comments:

Post a Comment

Thanks for your comment.