1. 30 Apr, 2019 1 commit
    • totten's avatar
      CiviMail - Restore support for previewing action-tokens via TokenProcessor/Flexmailer · e026b9e4
      totten authored
      Overview
      --------
      
      When using `TokenProcessor` to generate a mailing (e.g.  as with Flexmailer/Mosaico), the action-tokens (e.g.
      `{action.optOutUrl}`) are generated via `CRM_Mailing_ActionTokens`.  To properly generate them,
      `CRM_Mailing_ActionTokens` relies on certain information (e.g.  mailing/job ID).  However, that information is no
      longer available when performing a "Preview" -- leading to misbehavior in previews.  This patch allows Flexmailer to
      restore parity for previewing those tokens.
      
      Before (Pre-5.6)
      ----------------
      
      * When a user begins composing a mailing, CiviMail creates a draft mailing with a concrete ID (e.g.  `mailing #123`).
      * To preview the mailing, the UI calls `Mailing.preview` API with the ID of the mailing.
      * Flexmailer/Mosaico generates the preview by calling `TokenProcessor` and therefore `CRM_Mailing_ActionTokens`.
      * `CRM_Mailing_ActionTokens` has strictness checks. These pass because the ID is available.
      
      Before (5.6-5.12)
      ----------------
      
      As a performance enhancement, CiviCRM 5.6 (PR #12509; [mail#20](mail#20)) revised
      the signature for `Mailing.preview` API to allow previews *without* having a specific mailing record/job/ID. Consequently:
      
      * When a user begins composing a mailing, CiviMail creates a draft mailing with a concrete ID (e.g.  `mailing #123`).
      * To preview the mailing, the UI calls `Mailing.preview` API ~~with~~ **without** the ID of the mailing.
      * Flexmailer/Mosaico generates the preview by calling `TokenProcessor` and therefore `CRM_Mailing_ActionTokens`.
      * `CRM_Mailing_ActionTokens` has strictness checks. These ~~pass~~ **fail** because the ID is ~~available~~ **unavailable**.
      
      After
      ----------------
      
      * When a user begins composing a mailing, CiviMail creates a draft mailing with a concrete ID (e.g.  `mailing #123`).
      * To preview the mailing, the UI calls `Mailing.preview` API ~~with~~ **without** the ID of the mailing.
      * Flexmailer/Mosaico generates the preview by calling `TokenProcessor` and therefore `CRM_Mailing_ActionTokens`.
      * `CRM_Mailing_ActionTokens` has ~~strictness~~ **less strict** checks. These **pass** because the `context[schema]` hints that
        a mailing ID *will be available* when needed.
      e026b9e4
  2. 05 Apr, 2019 1 commit
  3. 13 Dec, 2018 1 commit
  4. 19 Apr, 2018 1 commit
    • totten's avatar
      (NFC) Update version in header · fee14197
      totten authored
      This is a simple administrative update to the headers. It was generated with the command:
      
      ```
      rgrep '| CiviCRM version 4.7' CRM/ Civi ang api bin extern install/ settings/ templates -l \
        | xargs sed -i'' "s/| CiviCRM version 4.7/| CiviCRM version 5  /g"
      ```
      
      Tthe inclusion of `|` aimed to avoid matching any non-header text (e.g. inline docs that
      mentioned the version incidentally). But then I did a looser search and for just
      
      ```
      rgrep 'CiviCRM version 4.7'
      ````
      
      and manually patched the remainder.
      
      Note: I'm not really keen on doing this every month, so I relaxed the header
      statement -- instead of `CiviCRM version 5.0`, it's just `CiviCRM version 5`.
      fee14197
  5. 23 Feb, 2018 1 commit
  6. 23 Feb, 2017 1 commit
    • totten's avatar
      CRM_Mailing_ActionTokens - Degarde gracefully · 9091e034
      totten authored
      Most of the `CRM_*_Tokens` classes include a `checkActive()` function whic
      prevents them from trying to do anything if they don't have the necessary
      data.  However, this one was missing it, which means that it attempts to
      evalute `{action.*}` tokens even when they're not valid.
      9091e034
  7. 02 Jan, 2017 1 commit
  8. 22 Dec, 2016 2 commits
  9. 20 Dec, 2016 1 commit