Share Your Knowledge!

This fast-growing section of our site is the new one-stop shop for educational materials for ExpressionEngine with rich and expert content, from both EllisLab and the community. Submit your article, tip, or solution today!

  • How to Use Live Preview

    in: Tutorials, Configuration
    This article originally appeared on leihu.com, written by EllisLab’s Chief Creative Officer, James Mathias.

    Starting in ExpressionEngine 4.1 you can give content editors, clients, and yourself a way to preview content in the context of the appropriate front end template, in real time.

    It’s quite simple to setup. To get started you’ll need the following;

    • A Channel (new or existing).
    • A template that displays the content of the above Channel.
    • Some content for previewing.

    Step 1

    Make sure you have a template that displays the content from your Channel on the front end. A basic template would be something like;

    {exp:channel:entries channel='blog' limit='1' require_entry='yes'}
    	<h1>How to use <i>Live Preview in ExpressionEngine</i></h1>
    	<p>September 2018, by {author}</p>

    The template doesn’t require anything special to be used as a Live Preview template, it just needs to be able to show the Channel’s data.

    Step 2

    Setting up your Channel to use Live Preview. Within the Channel Manager click the name of the Channel you wish to edit, then click the Settings tab and under “URL and Path Settings” find the field “Preview URL”. Enter the Path or Route to the Template you want to use for Live Preview.

    Step 3

    Create or Edit an entry within the Channel we just set up. At the top and bottom of the Publish form you’ll see a new blue button called “Preview”. Click it!

    Now you’ll find your self in Live Preview. Any edits you make to the Publish form will be reflected in real time in the Live Preview pane on the right, or above the form if Previewing from a mobile device.

    No more guessing or tab/context switching. Just editing and previewing.

    Step 4

    Save time, and delight your clients!

    | Read in 2 minutes
  • Using Gmail SMTP to Send Emails from your Website

    in: Tutorials, Configuration

    Gmail’s SMTP server requirements differ from ExpressionEngine’s defaults. Google also has a few extra steps on their end to get up and running. Here’s how.

    Create an App Password for your Google Account

    If you have enabled 2-Step Verification on your Google account—which you have, right?—you will need to set up an app password that ExpressionEngine can use to authenticate. In Google, visit My Account, Sign-in & security, and under the Signing in to Google section, visit “App passwords”. Here is a direct link: https://myaccount.google.com/apppasswords.

    On the following screen, choose “Other” under “Select app”, and type in the name of your website or your domain. This will help you remember what you generated this app password for.

    Click Generate. Google will then give you the app password that you will use in ExpressionEngine. You need to copy this password to your clipboard or keep the browser window open. When you click Done, there is no way to retrieve this app password. Don’t worry if you jumped the gun and clicked Done before copying though; just revoke the app password and make another one.

    The generated app password. Copy this to the clipboard before closing the window.
    The generated app password. Copy this to the clipboard before closing the window.

    If you do not have 2-Step Verification enabled, and for some reason do not want to enable it, you will have to enable less secure sign-ins under Connected apps & sites. Toggle the switch under “Allow less secure apps” to “ON”.

    Configure Outgoing Email Settings in ExpressionEngine

    In ExpressionEngine, navigate to Settings > Outgoing Email. Change the Protocol to SMTP which will open the SMTP Options. Use the following settings:

    Server address
    Server port
    The app password you generated earlier
    Connection type
    SSL (ssl://)

    Lastly make sure your Newline character setting on this page is set to \r\n, a requirement for Google’s SMTP servers.

    That’s it!

    You are finished and ready to start sending emails through your Gmail account. In the Developer menu, visit Utilities, and from the Communicate utility, send yourself a test email to verify that everything is working. If you get an error message, go back through the steps starting with your Google My Account page, and verify your settings.


    Using Gmail for website-generated emails is less than ideal. There is a sending limit of 100 emails per day via SMTP (G Suite accounts with a custom domain don’t suffer this limitation). But marketing and even transactional emails coming from a Gmail account may get flagged by email servers as spam, or even as phishing emails. This affects both the deliverability of your emails as well as your account reputation. Google has a laundry list of bulk sender guidelines, and problems might result in your Gmail account being suspended.

    So as a general rule, we do not recommend using Gmail SMTP for your website’s emails. It can be okay for your development environment, or if you just need something better than PHP mail() or sendmail for admin notifications, password reset emails, etc., and have only a handful of users. If your site has an email contact form, member registration, commenting, or discussion forums, you should use a transactional email service like:

    Marketing emails are a different category from transactional emails, which are the type triggered by a user taking an action. Registering, resetting a password, being notified of subscribed comments, and so on. For marketing and bulk email, you should use a service made for that purpose like Campaign Monitor, ConstantContact, or MailChimp. Some of the transactional providers also handle marketing emails, and mention that specifically in their marketing.

    If you are running a version of ExpressionEngine older than 3.5.0, this article still applies but you will need to set the newline and connection type manually in your system/user/config.php file.

    | Read in 4 minutes
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases