Setting up Email

Respond uses the PHPMailer project to send email within the system. So when a user signs up for a site, signs up for a subscription, or sends an email from a form on your site, it all goes through PHPMailer.

Default Configuration

By default, email is sent out via the default mail provider configured on your server. If you followed the Digital Ocean installation or use another VPS, you probably don't have one. Some shared servers offer this as an option. But, we think it is much better to outsource to a provider that specializes in this.

Email from the app is always sent out to the primary email setup on the account.

Custom Configuration

To setup a custom email provider, Respond provides an SMTP configuration option. This is located in the .env file in the root.

Variable Description
EMAILS_FROM The from email address for emails sent by the app.
EMAILS_FROM_NAME The from name for emails sent by the app.
IS_SMTP Specifies whether the email is sent via SMTP.
SMTP_HOST The SMTP Host for the server sending the emails
SMTP_AUTH The SMTP Auth flag.
SMTP_USERNAME The username to access the SMTP server.
SMTP_PASSWORD The password to access the SMTP server.
SMTP_SECURE The type of security used by the server.
SMTPENC_KEY The penc key used by the server.

Setting up Email Per Site

You can configure Respond to send emails when forms are submitted by setting up the per site email settings. To do this, simply edit the settings.json file at resources/sites/my-site/settings.json.

 [
   ...
    {
        "id": "EMAILS_FROM",
        "value": "matt@matthewsmith.com"
    },
    {
        "id": "EMAILS_FROM_NAME",
        "value": "Matt @ Respond"
    },
   {
        "id": "IS_SMTP",
        "value": true
    },
    {
        "id": "SMTP_HOST",
        "value": "sample.host"
    },
    {
        "id": "SMTP_PORT",
        "value": 25
    },
    {
        "id": "SMTP_AUTH",
        "value": true
    },
    {
        "id": "SMTP_USERNAME",
        "value": "username"
    },
    {
        "id": "SMTP_PASSWORD",
        "value": "password"
    },
    {
        "id": "SMTP_SECURE",
        "value": "tls"
    },
    {
        "id": "SMTPENC_KEY",
        "value": "iloverespond"
    }
 ]
      

Customizing Email Content

You can easily customize the content in your emails by just editing an HTML file. The following emails are sent out from the Respond application:

Email File Description
Welcome Email resources/emails/new-user.html Sent out to the new user when a site is created.
Reset Password resources/emails/reset-password.html Sent out when a user selects to reset a password.