-
Notifications
You must be signed in to change notification settings - Fork 76
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
Storage for individual Mosaico mailings #72
Comments
I would prefer core columns approach as well - also provides room for other possible template builders in future e.g - https://beefree.io/ (template_type = 'beefree'). With the core support would it be better to have code structured in a way that it also allows other possible template builders to inject / take control? Need not be perfect at this point, but can evolve as new template builders appear / integrated? And in doing so it could also template builders to use their own tables if needed? And totally agree on the idea of getting rid of hash_key and local storage. |
Yes, we'll need a way for the alternative template builders to inject themselves. Generally, expect two touch-points:
Will report back when I have more details. |
It was good to have some discussion/evaluation here, but -- based on the chosen design -- the locus of attention on this shifted to CRM-19690, so I think we can close this. |
If you consider both traditional content (
body_html
) and newer Mosaico-based content (metadata + content + rendered HTML), and consider both the use-cases of templates and individual mailings, then we have four scenarios for storing things in the database:civicrm_msg_template
records withbody_html
)civicrm_mailing
records withbody_html
)civicrm_mosaico_msg_template
withtemplate
,metadata
,html
pluscivicrm_msg_template
)There's currently no data-storage for saving a Mosaico-style mailing in its canonical/pristine form (without additional records in
civicrm_msg_template
andcivicrm_mosaico_msg_template
and synchronization logic). As we simplify the workflows for Mosaico, we need some way to pristinely store a Mosaico-style mailing.I'm intending to work on this next week but wanted to verbalize some approaches first (partially for my own clarity - but also in case @deepak-srivastava or other folks see additional issues). The approaches are:
civicrm_mailing
template_type
(varchar), e.g.traditional
ormosaico
template_options
(longtext), e.g. JSON blob containing Mosaico'smetadata
anddata
andhtml
template_type
and open a proper editor.template_type
andtemplate_options
(e.g. supporting other formats like Twig or refining the Smarty options or fixing the way CiviMail's Smarty-integration breaks the Smarty cache).civicrm_mosaico_mailing
:id
(int)mailing_id
(int, FK tocivicrm_mailing
for 1:1 relation)template
,metadata
,html
(same ascivicrm_mosaico_msg_template
)civicrm_mosaico_msg_template
so that it can store Mosaico-style templates or mailings:civicrm_mosaico_template
and useentity_table
/entity_id
, e.g.id
entity_table
,entity_id
(e.g.civicrm_mailing,200
orcivicrm_msg_template,50
)template
,metadata
,html
(same ascivicrm_mosaico_msg_template
)civicrm_mosaico_template
with differententity_table
values.Personal preference is to define core columns because it addresses
(Tangential Observation: None of those options above discuss the
hash_key
. That field is part of Mosaico'slocalStorage
adapter, but they have recommendations which allow you to ignore thelocalStorage
andhash_key
stuff when you have your own storage mechanism. See also: voidlabs/mosaico#73 (comment) IMHO, keeping thelocalStorage
/hash_key
makes it hard to think about the dataflow because client-state and server-state may not match.)The text was updated successfully, but these errors were encountered: