Skip to content

Commit

Permalink
(NFC) More consistent layout for 'hook_civicrm_alterMailParams' asser…
Browse files Browse the repository at this point in the history
…tions
  • Loading branch information
totten committed Sep 25, 2021
1 parent 650646e commit f82156e
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions tests/events/hook_civicrm_alterMailParams.evch.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,44 @@

private $paramSpecs = [

// Envelope: Common
// ## Envelope: Common

'toName' => ['type' => 'string|NULL'],
'toEmail' => ['type' => 'string|NULL'],
'cc' => ['type' => 'string|NULL'],
'bcc' => ['type' => 'string|NULL'],
'headers' => ['type' => 'array'],
'attachments' => ['type' => 'array|NULL'],
'PDFFilename' => ['for' => 'messageTemplate', 'type' => 'string|NULL'],
'isTest' => ['type' => 'bool|int'],

// Envelope: singleEmail/messageTemplate
// ## Envelope: singleEmail/messageTemplate

'from' => ['type' => 'string|NULL', 'for' => ['messageTemplate', 'singleEmail']],
'replyTo' => ['type' => 'string|NULL', 'for' => ['messageTemplate', 'singleEmail']],
'returnPath' => ['type' => 'string|NULL', 'for' => ['messageTemplate', 'singleEmail']],
'isEmailPdf' => ['type' => 'bool', 'for' => 'messageTemplate'],
'PDFFilename' => ['type' => 'string|NULL', 'for' => 'messageTemplate'],
'autoSubmitted' => ['type' => 'bool', 'for' => 'messageTemplate'],
'Message-ID' => ['type' => 'string', 'for' => ['messageTemplate', 'singleEmail']],
'messageId' => ['type' => 'string', 'for' => ['messageTemplate', 'singleEmail']],

// Envelope: CiviMail
// ## Envelope: CiviMail

'Reply-To' => ['for' => ['civimail'], 'type' => 'string|NULL'],
'Return-Path' => ['for' => ['civimail'], 'type' => 'string|NULL'],
'From' => ['for' => ['civimail'], 'type' => 'string|NULL'],
'Subject' => ['for' => ['civimail'], 'type' => 'string|NULL'],
'List-Unsubscribe' => ['for' => ['civimail'], 'type' => 'string|NULL'],
'job_id' => ['for' => ['civimail'], 'type' => 'int|NULL'],
'Reply-To' => ['type' => 'string|NULL', 'for' => ['civimail']],
'Return-Path' => ['type' => 'string|NULL', 'for' => ['civimail']],
'From' => ['type' => 'string|NULL', 'for' => ['civimail']],
'Subject' => ['type' => 'string|NULL', 'for' => ['civimail']],
'List-Unsubscribe' => ['type' => 'string|NULL', 'for' => ['civimail']],
'job_id' => ['type' => 'int|NULL', 'for' => ['civimail']],

// Content
// ## Content

'subject' => ['for' => ['messageTemplate', 'singleEmail'], 'type' => 'string'],
'text' => ['type' => 'string|NULL'],
'html' => ['type' => 'string|NULL'],

// Model: messageTemplate
// ## Model: messageTemplate

'tokenContext' => ['type' => 'array', 'for' => 'messageTemplate'],
'tplParams' => ['type' => 'array', 'for' => 'messageTemplate'],
'contactId' => ['type' => 'int|NULL', 'for' => 'messageTemplate' /* deprecated in favor of tokenContext[contactId] */],
Expand All @@ -61,15 +62,17 @@
'model' => ['for' => 'messageTemplate', 'type' => 'NULL'],
'modelProps' => ['for' => 'messageTemplate', 'type' => 'NULL'],

// Model: Adhoc/incomplete/needs attention
// ## Model: Adhoc/incomplete/needs attention

'contributionId' => ['type' => 'int', 'for' => 'messageTemplate'],
'petitionId' => ['type' => 'int', 'for' => 'messageTemplate'],
'petitionTitle' => ['type' => 'string', 'for' => 'messageTemplate'],
'table' => ['type' => 'string', 'for' => 'messageTemplate', 'regex' => '/civicrm_msg_template/'],
'entity' => ['type' => 'string|NULL', 'for' => 'singleEmail'],
'entity_id' => ['type' => 'int|NULL', 'for' => 'singleEmail'],

// View: messageTemplate
// ## View: messageTemplate

'messageTemplateID' => ['type' => 'int|NULL', 'for' => 'messageTemplate'],
'messageTemplate' => ['type' => 'array|NULL', 'for' => 'messageTemplate'],
'disableSmarty' => ['type' => 'bool|int', 'for' => 'messageTemplate'],
Expand Down

0 comments on commit f82156e

Please sign in to comment.