Skip to content

Activity options for details field

Rich requested to merge artfulrobot/emailapi:activity-options into master

This one takes the activity creation further and gives some options of what to store.

Before this PR, the html and text versions of the message are saved (if both exist).

After this PR, the same happens unless you specify a different value for activity_details. You can choose html, text or both, or just the name of the message template. The reason for this being useful are:

  • disk space: it may take up significant disk space to store near-identical copies of the full body of every email sent, e.g. I have petition sites that may collect nearly 300M signatures, and I don't want to store 300M copies of the thank you email.

  • HTML for email != HTML for websites! So they rarely show up right anyway (e.g. they may be a complete document <html>; they may include CSS rules that affect page display; our CSS will affect the content etc.)

  • Recording a text version only may be a neat way to record the key details (e.g personalisations) without the problems of storing HTML.

The tests (from !28 (merged) - needs merging first!) are updated to cover this new parameter.

Edited by Rich

Merge request reports