Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Configuration

Tom Janssens edited this page Jan 14, 2015 · 4 revisions

The configuration file (config/config.php) requires a few custom properties to make everything run:

  • analytics: the GA tracking code
  • google_auth_client and google_auth_email: the API client (to make com:analytics work)
  • api_zendesk: Zendesk API token
  • sendgrid_user and sendgrid_key
  • http_proxy: the proxy required to establish outgoing connections on the SS servers. See HTTP Proxy.
  • old_codebase_root : the path to the location of the sites/ folder in the v1 codebase. Required in com:uploads to import images from the v1 articles.

E-mail

Sending out e-mails from the code can easily be done using the com:mailer.controller.mailer object. See the com:support.database.behavior.notifiable behavior for an example.

We currently have three available methods to send out e-mail:

  1. Sendgrid via their HTTP API - this is used on the servers because the firewall blocks outgoing smtp connections
  2. Using an SMTP server (uses Swiftmailer) - this is useful for mailcatcher, point your smtp server to localhost:1025 and read all outgoing mails via http://police.dev:1080
  3. Fallback: default PHP mail() (Uses Swiftmailer's Swift_MailTransport class)

The $method configuration option in config/config.php is used to determine the e-mail method, set to either:

  1. sendgrid
  2. smtp
  3. mail

The Sendgrid mailer requires these extra config.php properties:

 var $sendgrid_user = 'belgianpolice';
 var $sendgrid_key = 'key';

The SMTP settings in config.php should be self-explanatory. You should add $smtpport though if you're not using a default port. Example (for mailcatcher smtp):

var $mailer = 'smtp';
var $smtpauth = '0';
var $smtpuser = 'root';
var $smtppass = '';
var $smtphost = 'localhost';
var $smtpport = 1025;

Important: always set the mailfrom en fromname variables! The mailers will throw exceptions otherwise because the from address is malformed. Example:

var $mailfrom = '[email protected]';
var $fromname = 'Belgian Police Local';
Clone this wiki locally