Details

    • Type: Sub-task
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.6
    • Fix Version/s: 4.6
    • Component/s: CiviMail
    • Labels:
      None
    • Documentation Required?:
      None

      Description

      When browsing the list of mailings, one sees both (a) traditional standalone mailings and (b) the constituents of any A/B tests. The user should be directed to a suitable UI when clicking a link for an A/B test mailing.

      It can be fairly complicated to introduce JOINs in our selectors. Instead, we should add a column for "mailing_type" which can differentiate between standalone mailings, A/B tests, and A/B final-winner (and possibly scheduled-reminders and SMS... but that's outside scope).

      (We've gone back and forth a bit on the exact UX. The UX here could theoretically done without the DB change, but some do require DB change, and this is still an opportune time for the DB change.)

      Data Model Changes:

      A1. Add CRM_Mailing_PseudoConstant::mailingType() which returns

      • "standalone" => ts("Standalone")
      • "experiment" => ts("Experimental")
      • "winner" => ts("Winner")
        A2. Add a VARCHAR(32) column, "mailing_type", to "civicrm_mailing" and declare the pseudoconstant..
        A3. Test that the pseudoconstants are correctly configured in XML by calling the getoptions API (e.g. "drush cvapi Mailing.getoptions field=mailing_type" should print out the list of mailing types)
        A4. Upgrade: For pre-existing mailings, fill in "mailing_type" as "standalone."
        A5. Upgrade: For A/B tests created during alpha-cycle, set the "mailing_type" to experimental (A/B) or winner (C).

      Runtime Changes

      B1. Update the Mailing.create API to set the default mailing_type to "standalone". (Note: The "New Mailing" UI will respect the defaults from the API.)
      B2. Update the A/B test UI to set mailing_types of "experiment" (for A+B) and "winner" (for the selection). (See js/angular-crmMailingAB/services.js – look for "mailingDefaults".)
      B3. When processing the "Mailing => Draft => Continue" link ("civicrm/mailing/send" aka "CRM_Mailing_Controller_Send"), check the mailing type and redirect accordingly:

      • For "standalone", redirect to civicrm/a/#/mailing/MAILING_ID
      • For "experiment" or "winner", redirect to civicrm/a/#/abtest/ABTEST_ID
        B4. When processing the "Mailing => Sent => Report" link ("civicrm/mailing/report" aka "CRM_Mailing_Page_Report"), check the mailing type.
      • For "experiment" or "Winner", redirect to civicrm/a/#/abtest/ABTEST_ID
        B5. (MOVED: Merge the compose/review/report screens for A/B tests so that they work with the same URL (i.e. "civicrm/a/#/abtest/ABTEST_ID"). – This is now CRM-15995; PR submitted.)

      (Note: The A/B test goes through different statuses where it may contain a mix of draft and scheduled mailings. With B3+B4+B5, the redirector doesn't need to fully understand these details – the A/B test UI will deal with them.)

        Attachments

          Activity

          [CRM-15979] Differentiate standalone mailings from A/B test mailings
          Tim Otten added a comment -

          Discussed with dgg, and I need to make some changes to the runtime side.

          Tim Otten added a comment -

          Changes:

          • Don't try to hide A/B mailings from the main listing. Instead, direct users to the appropriate screens.
          • Define mailing-types with simple array instead of option-group/option-value. OG/OV might be a good idea, but it's speculative. Better to put time into things that are concrete (e.g. migrating data). KISS.

          @kurund, could you review this and assign to someone on the India team? I'll work on B5, but I think all the other steps should be pretty be doable for anyone with decent Civi experience.

          Tim Otten added a comment - - edited

          I've moved my piece (B5) to its own ticket (CRM-15995) and submitted a PR.

          Atif Shaikh added a comment -
          Atif Shaikh added a comment -

          Tim, can you please QA my PR

          Tim Otten added a comment -
          Atif Shaikh added a comment -

          Totten I have updated my PR, can you please review, merge and close if ok. Thanks

          Tim Otten added a comment -

          Looks good. Merged.

            People

            • Assignee:
              Atif Shaikh
              Reporter:
              Tim Otten

              Dates

              • Created:
                Updated:
                Resolved: