Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-19690 - CiviMail/FlexMailer - Allow alternative email templating systems #9497

Closed
wants to merge 19 commits into from

Commits on Dec 20, 2016

  1. CRM-19690 - Declare Mailing.template_type, Mailing.template_options, …

    …Hook::mailingTemplateTypes.
    
    This adds two new fields to the schema.
    
    Template types can be declared (along with preferred editor) using
    hook_civicrm_mailingTemplateTypes, e.g.
    
    ```
    function mymod_civicrm_mailingTemplateTypes(&$types) {
      $types[] = array(
       'name' => 'moasico',
       'editorUrl' => '~/crmMosaico/EditMailingCtrl/mosaico.html',
      );
    }
    ```
    
    Note: This only stores data.  Other commits will make use of that data in
    more meaningful ways.
    totten committed Dec 20, 2016
    Configuration menu
    Copy the full SHA
    725da87 View commit details
    Browse the repository at this point in the history
  2. CRM-19690 - Mailing API - Encode and decode template_options

    Present API consumers with a consistent, array-based interface for reading
    and writing properties in a Mailing.
    
    Suppose you're submitting a REST request to create a mailing.  The REST
    request as a whole is encoded with JSON.  With the default API behavior, you
    would need to double-encode the `template_options`, e.g. roughly
    
    ```
    POST rest.php
      json_encode([
        entity => Mailing
        action => create
        params => [
          template_options => json_encode([...])
        ]
      ])
    ```
    
    With this patch, you only need to encode the request once.
    
    This parallels the approach used in CaseType API (for the XML `definition`
    field).
    totten committed Dec 20, 2016
    Configuration menu
    Copy the full SHA
    5a25fd7 View commit details
    Browse the repository at this point in the history
  3. CRM-19690 - crmMailing - Pick editor layout using template_type

    General notes:
    
     1. When creating a mailing, use the path `civicrm/a/#/mailing/new` to create a mailing with the default `template_type` (aka first-preferred, by weight).
     2. When creating a mailing, use the path `civicrm/a/#/mailing/new/{template_type}` to create a mailing with a specific `template_type`.
     3. When editing a mailing, check the `template_type` and load the appropriate editor.
     4. Some of the boilerplate from `2step.html`, `unified.html`, etal has been moved to `base.html`.
    
    Note that this breaks a hidden feature -- before, you could switch among a
    few different layouts (`2step`, `unified`, `unified2`, `wizard`) by manually
    editing the URL (e.g.  `civicrm/a/#/mailing/2/unified`). Now, to change
    the layout of the traditional-style mailings, you can implement a hook, e.g.
    
    ```
    function mymod_civicrm_mailingTemplateTypes(&$types) {
      foreach ($types as &$typeDef) {
    if ($typeDef['name'] === 'traditional') {
      $typeDef['editorUrl'] = '~/crmMailing/EditMailingCtrl/unified.html';
    }
      }
    }
    ```
    totten committed Dec 20, 2016
    Configuration menu
    Copy the full SHA
    45a555b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    88797e4 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f3958c9 View commit details
    Browse the repository at this point in the history
  6. CRM-19690 - CRM_Utils_Token::getAnonymousTokenDetails() - Add missing…

    … `static`
    
    This function is only called once, and it previously lacked test coverage,
    so the `static` warning previously snuck through. Fix it!
    totten committed Dec 20, 2016
    Configuration menu
    Copy the full SHA
    913d8aa View commit details
    Browse the repository at this point in the history
  7. CRM-19690 - Mailing - Make getTemplates and getVerpAndUrlsAndHeaders …

    …public
    
    These two functions will be useful in FlexMailer's DefaultEngine.
    totten committed Dec 20, 2016
    Configuration menu
    Copy the full SHA
    d2fc467 View commit details
    Browse the repository at this point in the history
  8. CRM-19690 - AbstractTokenSubscriber - Only evaluate tokens that are used

    This is more significant with mailing tokens because some of them are fairly
    sizeable/expensive.
    totten committed Dec 20, 2016
    Configuration menu
    Copy the full SHA
    671bd6c View commit details
    Browse the repository at this point in the history
  9. CRM-19690 - CRM_Mailing_Tokens - Add TokenProcessor support

    This includes support for both `{mailing.*}` and `{action.*}` tokens used in
    CiviMail.
    totten committed Dec 20, 2016
    Configuration menu
    Copy the full SHA
    22d558d View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    decc37b View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    afd56cc View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    0ba21be View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    4da0e13 View commit details
    Browse the repository at this point in the history
  14. CRM_Extension_System - Fix extra slash in vendor URLs

    If you install an extension under `$cmsRoot/vendor/org.example.foo`, the
    resulting URL contains an extraneous `/` (eg
    `http://example.org//vendor/org.example.foo`).  (In Windows, I suspect it's
    even worse because it uses DIRECTORY_SEPARATOR in the URl -- eg
    `http://example.org/\vendor/org.example.foo`.)
    
    This patch checks for and removes the extraneous slash -- and always
    constructs the URL with the appropriate delimiter (`/`).
    
    Problem observed in `dmaster`.
    totten committed Dec 20, 2016
    Configuration menu
    Copy the full SHA
    86680ca View commit details
    Browse the repository at this point in the history

Commits on Dec 23, 2016

  1. CRM-19690 - CRM_Mailing_Tokens - Remove unused getTrackOpenUrl

    During development of FlexMailer, I flirted with using a special token (e.g.
    `{actions.trackOpen}`) but ultimately found that was positioned well in
    the order of operations.
    totten committed Dec 23, 2016
    Configuration menu
    Copy the full SHA
    274a594 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6c225c2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    591183b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    bddb863 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c5e041b View commit details
    Browse the repository at this point in the history