Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Is it possible to define message templates in code/files somehow?
If not, this is actually a feature request. Would be a perfect fit for Ctools' exportables API, wouldn't it?
Comment | File | Size | Author |
---|---|---|---|
#12 | messaging_features_1.patch | 3.92 KB | fatfish |
#11 | messaging_features.patch | 3.77 KB | malcomio |
#10 | messaging_features.patch | 3.64 KB | malcomio |
Comments
Comment #1
Dane Powell CreditAttribution: Dane Powell commentedAgreed, it would be really helpful if message templates could be exported and overridden (via Features). Shouldn't be too hard to code I imagine, but the ROI isn't high enough for me to tackle it myself :)
Also, this might only officially happen in 4.x, which is fine- but I'd appreciate a patch for 2.x as well, since not all of us are able to upgrade (being bound to Open Atrium and the like...)
Comment #2
Dane Powell CreditAttribution: Dane Powell commentedI don't think any new features are going in 2.x
Comment #3
maddentim CreditAttribution: maddentim commentedMaking templates exportable would be useful. Certainly from a convenience standpoint, but also from a security / stability standpoint. Since these templates drive emails to my clients, I was fear somehow one of these variables reverting the default instead of the customized message.
Can this be considered for 6.x-4.x? or in 7.x? Or is it already supported?
Comment #4
EugenMayer CreditAttribution: EugenMayer commentednot in 4.x yet. Iam considering helping out here, if the maintainer interested
Comment #5
Dane Powell CreditAttribution: Dane Powell commentedI am not a true "maintainer" but I do have commit access. If you can get a patch to RTBC I will commit it.
Comment #6
EugenMayer CreditAttribution: EugenMayer commentedWell my plan:
- integrate it with ctools exportables
- integrate it that way using features
the module will probably get to big, might be better to start it as a own project to split maintanace? What do you think?
Comment #7
Dane Powell CreditAttribution: Dane Powell commentedYeah, you might consider adding it to the "notifications_extra" package. It just depends on exactly how big it gets.
Comment #8
EugenMayer CreditAttribution: EugenMayer commentedwell, what about http://drupal.org/node/800614 ? is that one compatible with 4.x?
Comment #9
EugenMayer CreditAttribution: EugenMayer commentedIts looks pretty good, eventhough its not integrated using ctools exportables.
AFAIC the only issue is the submit form, as tpid is not build in, which will create dupes and will not work out ( tpid has been invented in 4.x ). So more or less, the integration is not bad, but will not work out for 4.x OOTB. In addition, language is also missing, so that one will need to get fixed also
- AFAIC we need a identifier-touple of (type, msgkey, method, module, language) . Iam not very sure about module though.
- Data fields are: format, data, message
- skippoing tpid, as it seems to be only used for "updates" in the admin form.
So basically i would integrate the identifier touple with ctools-exportables, in addition i would use the http://drupal.org/project/exportables contrib to build up the mapping table. Thats it. Some feature hooks to define what is exportable and should be it
Comment #10
malcomio CreditAttribution: malcomio commentedHere's a patch based on the version 2 patch from http://drupal.org/node/800614
I haven't had time to look into exportables, but it seems to work.
Comment #11
malcomio CreditAttribution: malcomio commentedrealised I'd left out module and language - try again...
Comment #12
fatfish CreditAttribution: fatfish commentedFix language store. I added language code as additional variable (e.g. ::en) to the feature key. Now we can select to export/revert messaging template at any language individual.
The key principly is key structure as created here: