Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Add proper setting for toggling Flexmailer on traditional mailings #37

Merged
merged 3 commits into from
Apr 30, 2019

Conversation

totten
Copy link
Member

@totten totten commented Apr 26, 2019

Before

When you enable Flexmailer, it is used for new-style mailings (e.g. Mosaico). However, it is not used to deliver traditional mailings.

There is a hidden/undocumented setting (experimentalFlexMailerEngine) to toggle this. The setting has primarily been used for automated testing, but it has also been communicated to other developers/implementers.

After

  • There is a setting flexmailer_traditional which dictates whether Flexmailer will try to process traditional mailings.
  • The setting is exposed in a new admin form.
  • The old hidden setting experimentalFlexMailerEngine is mostly removed. However, if you have flexmailer_traditional=auto, it will fallback and obey experimentalFlexMailerEngine.

Comments

The automated tests rely on some forms of this setting to work correctly.

Additionally, to make sure that every form was tried in a realistic way, I used these manual steps:

  • Setup a test site. Enable Flexmailer with this patch. Configure outbound mail to go an SMTP simulator (eg mailcatcher).
  • Locally, hack Civi\FlexMailer\Listener\BasicHeaders to set $mailParams['X-Flexmailer'] = 'Yes';. This way, you can determine which engine sent a message by inspecting the headers.
  • Prepare a draft mailing.
  • Check: Does CiviMail's test/preview functionality work?
    • Repeat this procedure for each value of flexmailer_traditional (auto, bao, flexmailer):
      • Set flexmailer_traditional to the desired value
      • Preview as text
      • Preview as HTML
      • Send test email to one address
      • Send test email a group
  • Submit the test mailing. Save a DB snapshot (e.g. civibuild snapshot dmaster --snapshot dm-send)
  • Check: Does delivery work?
    • Repeat this procedure for each value of flexmailer_traditional (auto, bao, flexmailer):
      • Restore DB
      • Set flexmailer_traditional to the desired value
      • Run the delivery
      • Check the resulting messages
      • (Ex: civibuild restore dmaster --snapshot dm-send && cv flush && cv api setting.create flexmailer_traditional=THE_VALUE && cv api -U admin job.process_mailing)

To work completely, depends on #38. However, that's a preexisting issue, and it mostly works without.

@civibot civibot bot added the master label Apr 26, 2019
@totten totten force-pushed the master-setting branch 2 times, most recently from 7b577b2 to 099f22a Compare April 27, 2019 00:34
@totten totten changed the title (WIP) Add proper setting for toggling Flexmailer on traditional mailings Add proper setting for toggling Flexmailer on traditional mailings Apr 27, 2019
@totten totten force-pushed the master-setting branch 2 times, most recently from 3302e4c to a063e6f Compare April 30, 2019 17:41
@totten
Copy link
Member Author

totten commented Apr 30, 2019

Rebased. Also updated to use more objective terminology (e.g. bao instead of legacy).

Re-tested on current CiviCRM 5.13-RC branch.

civicrm-core   flexmailer              mosaico || mos-preview  mos-send-test   mos-submit       mos-anon        || trad-preview trad-send-test  trad-submit     trad-anon
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
5.13           master-setting[auto]    2.x     || OK            OK              OK              OK*             || OK           OK              OK              Fail
5.13           master-setting[flx]     2.x     || OK            OK              OK              OK*             || OK           OK              OK              OK*
5.13           master-setting[bao]     2.x     || OK            OK              OK              OK*             || OK           OK              OK              Fail

Definitions:

  • mos-*: Tested with Mosaico mailing
  • trad-*: Tested with traditional mailing
  • *-preview: In CiviMail composition UI, use "Preview" buttons. Check a few contact+action+mailing tokens.
  • *-send-test: In CiviMail composition UI, use "Send Test" button. Check a few contact+action+mailing tokens. Check for presence/absence of X-Flexmailer header.
  • *-submit: Submit the mailing. Run the cron job. Check a few contact+action+mailing tokens. Check for presence/absence of X-Flexmailer header.
  • *-anon: View the sent mailing in a browser as an anonymous user

So it generally looks good, except for the otherwise known/open issues around anonymously viewing a mailing in a browser.

@totten totten merged commit a1d4d54 into civicrm:master Apr 30, 2019
@totten totten deleted the master-setting branch April 30, 2019 18:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant