mailtrain icon indicating copy to clipboard operation
mailtrain copied to clipboard

Custom CSS not applying to live forms

Open m52go opened this issue 5 years ago • 11 comments

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):

Screenshot from 2020-09-16 19-07-18

However, when I view my actual live form, only the content edits show. The CSS edits don't.

Live (not correct style):

Screenshot from 2020-09-16 19-07-32

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).

m52go avatar Sep 16 '20 23:09 m52go

Where is this form? I can't seem to find it in the UI anywhere.

stoplion avatar Oct 08 '20 04:10 stoplion

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.

m52go avatar Oct 08 '20 05:10 m52go

it is still issue for me. hosted subscribe form not applying the formInputStyle properly.

hard coding css to

j-mir-prazak avatar Aug 27 '22 14:08 j-mir-prazak

@j-mir-prazak Could you explain a little bit more the steps for the workaround? I am having the same issue.

saschafoerster avatar Aug 27 '22 16:08 saschafoerster

@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..

Screenshot from 2022-08-27 18-59-27

j-mir-prazak avatar Aug 27 '22 17:08 j-mir-prazak

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

j-mir-prazak avatar Aug 28 '22 18:08 j-mir-prazak

@bures Could you pull this, please? :) Would be of great help for us to have our forms in style.

saschafoerster avatar Aug 28 '22 19:08 saschafoerster

Sure. Which PR?

bures avatar Aug 29 '22 05:08 bures

@bures #1288 my first pull request, so i don't know, if it's all you need? O_o

j-mir-prazak avatar Aug 29 '22 06:08 j-mir-prazak

Thanks. No big formalities. I trust you guys.

bures avatar Aug 29 '22 06:08 bures

@bures I just tested the fix, works great, Issue can be closed thanks to https://github.com/Mailtrain-org/mailtrain/pull/1288

saschafoerster avatar Aug 29 '22 20:08 saschafoerster

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.

forge0ne avatar Mar 16 '24 09:03 forge0ne