Skip to content

Latest commit

 

History

History
61 lines (49 loc) · 3.1 KB

options-reference.md

File metadata and controls

61 lines (49 loc) · 3.1 KB

1.0.0 Options Reference

Plugin Options

Required

  • transport: (function) A nodemailer transporter that has been configured
  • fromAddress: (string) The email address that emails will be sent from.

Optional

  • env: (string enum) The current environment that server is running in, valid options below.
    • development
    • local
    • production
  • templateSettings: (object) Settings that will be passed to all templates, see theme options below.

Route Options

Required

  • component: (function) A React component that uses mjml for rendering
  • subject: (string) A email subject that will be sent to the email client.

Template Settings

All template options are optional. If address, header image, or contact is not passed to the plugin, then props are required for their components.

If a value is set for anything, all values will be overwritten. For instance, if a color template setting is set, secondary, danger, success, etc. will no longer be available unless used in the new value.

If a setting is included, then the nested values will be required if marked as such.

  • colors: (object) An object that includes a key (e.g. primary) and a hex string (e.g. '#ECECEC').
    • primary: (string) A primary color to be used, required
  • header: (object) An object that affects the header settings
    • img: (object) An object that includes image data for headers
      • src: (string) A url for the image source required
      • alt: (string) An alt tag describing the image required
  • address: (object) An object that has address information for use in address components
    • name: (string) required
    • addressLine1: (string) required
    • addressLine2: (string) required
    • city: (string) required
    • state: (string) required
    • zip: (string) required
    • country (string) required
  • contact (array[object]) An array of objects with contact information
    • name: (string) Name describing the contact method
    • value: (string) Value of what will actually be displayed to user required
    • href: (string) Link for the contact (e.g. 'mailto:[email protected]')
    • type: (string enum) The type of contact. See below for possible values. required
      • phone
      • email
      • website
      • fax

Default Template Settings

  • colors: An object including possible color types
    • primary: #9b59b6
    • secondary: #95a5a6
    • danger: #f64747
    • success: #2ecc71
    • warning: #e67e22