mailtrain
mailtrain copied to clipboard
Custom CSS not applying to live forms
Hello, I edited CSS in the form input style area and content in the various forms. The CSS edits and content edits show in the form preview at the top. I've also set the list to use my custom forms.
Preview (correct style):

However, when I view my actual live form, only the content edits show. The CSS edits don't.
Live (not correct style):

I've tried creating a new list and applying the custom form on the initial setup, and I've also tried restarting my server. But the CSS edits don't show. Am I missing something?
For the record, I'm using Mailtrain v2. I recall having an issue like this on v1, but if I remember correctly, the user-facing list address changed when I applied the custom form—so I just went to the new list address and the styles were applied. But that doesn't seem to be the case here.
Anyone know what could be happening?
EDIT: upon further testing, this issue seems to only be affecting the main subscribe page (e.g., the confirm-subscription page is styled correctly).
Where is this form? I can't seem to find it in the UI anywhere.
Where is this form? I can't seem to find it in the UI anywhere.
When on the "Edit Custom Forms" screen (https://example.com/lists/forms/1/edit), I see it listed as "Web - Subscribe" in the Templates drop-down.
On my instance that form is live at https://lists.example.com/subscription/<list-id>.
I should note that I've since found out that email CSS seems to be rendering fine...but the forms hosted by my instance don't reliably render correctly.
Examples NOT working:
- subscribe form mentioned above
- manage preferences (
https://lists.example.com/subscription/<list-id>/manage/<subscriber-id>)
Example IS working:
- update your email address page (
https://lists.example.com/subscription/<list-id>/manage-address/<subscriber-id>)
All of these forms render with correct CSS applied in the custom forms preview area.
it is still issue for me. hosted subscribe form not applying the formInputStyle properly.
hard coding css to
@j-mir-prazak Could you explain a little bit more the steps for the workaround? I am having the same issue.
@saschafoerster if you go to "Edit custom forms" and have "Layout" selected in "Edit" option, there is the general layout with isWeb clause: there you can add your css declarations and it should take
you might need to delete {{{formInputStyle}}} and add all the css classes manually instead (copy them from Edit - "Form Input Style")
how his helps..

caused by error in /mailtrain/server/routes/subscription.js injectCustomFormData() - change form.formInputStyle to form.form_input_style - mysql record uses underscores so styles were not applied.
https://github.com/Mailtrain-org/mailtrain/blob/6c0f9e565036ab78b278246aee09f235c4b052cf/server/routes/subscription.js#L89
@bures Could you pull this, please? :) Would be of great help for us to have our forms in style.
Sure. Which PR?
@bures #1288 my first pull request, so i don't know, if it's all you need? O_o
Thanks. No big formalities. I trust you guys.
@bures I just tested the fix, works great, Issue can be closed thanks to https://github.com/Mailtrain-org/mailtrain/pull/1288
We are going to start with the development and testing of mailtrain v3 in the next weeks.
You are welcome to help us with the testing as soon as the first release candidate is available.