LogoLogo
Official SiteAPI Reference
stable/3.0
stable/3.0
  • Cement Developer Guide
  • Release Information
    • What's New!
    • Upgrading
    • ChangeLog
    • Deprecations
  • Getting Started
    • Installation
    • Developer Tools
    • Framework Overview
    • Beginner Tutorial
      • Part 1: Creating Your First Project
      • Part 2: Adding Features
      • Part 3: Extending a Project
      • Part 4: Making Everything Legit
  • Core Foundation
    • Interfaces and Handlers
    • Hooks
    • Configuration Settings
    • Arguments
    • Logging
    • Controllers
    • Output Rendering
    • Caching
    • Mail Messaging
    • Framework Extensions
    • Application Plugins
    • Templating
  • Utilities
    • Filesystem
    • Shell
    • Miscellaneous
  • Extensions
    • Alarm
    • Argparse
    • Colorlog
    • ConfigParser
    • Daemon
    • Dummy
    • Generate
    • Jinja2
    • Json
    • Logging
    • Memcached
    • Mustache
    • Plugin
    • Print
    • Redis
    • Scrub
    • SMTP
    • Tabulate
    • Yaml
    • Watchdog
  • Additional Topics
    • Extending The App Object
    • Unit Testing
    • Cleanup
    • Signal Handling
    • Pipenv
    • Autocomplete
    • Profiling with cProfile
    • Debugging with VSCode
  • Environment Variables
  • Terminology
  • Contributing
  • Privacy Policy
Powered by GitBook
On this page
  • Introduction
  • Requirements
  • Configuration
  • Usage
  1. Extensions

Dummy

PreviousDaemonNextGenerate

Last updated 6 years ago

Introduction

The Dummy Extension provides several placeholder type handlers to either mock operations or provide local-only usage during development. A perfect example is the that can be use during development or staging to prevent real email messages from being sent externally.

API References:

Requirements

  • No external dependencies

Configuration

DummyMailHandler

This extension supports the following configuration settings under a [mail.dummy] configuration section:

Setting

Description

to

Default recipient address (list, or comma separated depending on the config handler in use).

from_addr

Default sender address

cc

Default carbon-copy addresses (list, or comma separated depending on the config handler in use)

bcc

Default blind-carbon-copy addresses (list, or comma separated depending on the config handler in use)

subject

Default subject line

subject_prefix

Additional string to prepend to the subject line of all messages

Usage

from cement import App

class MyApp(App):
    class Meta:
        label = 'myapp'
        extensions = ['dummy']
        output_handler = 'dummy'
        template_handler = 'dummy'
        mail_handler = 'dummy'

with MyApp() as app:
    app.run()
DummyMailHandler
Cement Dummy Extension