Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Mailtrain
  3. How to make Mailtrain widget work?

How to make Mailtrain widget work?

Scheduled Pinned Locked Moved Solved Mailtrain
9 Posts 4 Posters 2.2k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • hiyukoimH Offline
      hiyukoimH Offline
      hiyukoim
      translator
      wrote on last edited by
      #1

      Hello, I have a question about Mailtrain widget.
      Mailtrain widget enables you to embed the newsletter signup form.

      On Mailtrain github documentation, they say like this.

      Subscription Widget
      The (experimental) Mailtrain Subscription Widget allows you to embed your sign-up forms on your website. To embed a Widget, you need to:
      Enable cross-origin resource sharing in your config file and whitelist your site:
      [cors] # Allow subscription widgets to be embedded origins=['https://www.example.com']
      Embed the widget code on your website:

      Does what they say "config file" means production.toml on Cloudron Mailtrain app?
      I added the script on .toml file, but it didn’t work on my server. Is there anything I should configure to make it work?

      Thank you!

      1 Reply Last reply
      0
      • nebulonN Offline
        nebulonN Offline
        nebulon
        Staff
        wrote on last edited by
        #2

        I just gave it a try and yes, you should put the adjusted snippet into /app/data/production.toml inside the mailtrain app and then restart the app (there is a restart button in the terminal view in the Cloudron dashboard for the app)

        1 Reply Last reply
        2
        • hiyukoimH Offline
          hiyukoimH Offline
          hiyukoim
          translator
          wrote on last edited by
          #3

          Thank you for checking and confirmation!

          I tried it by myself again. It only showed "Subscribe to our list" link.
          I thought I could embed signup forms on my wordpress website.

          1 Reply Last reply
          0
          • nebulonN Offline
            nebulonN Offline
            nebulon
            Staff
            wrote on last edited by
            #4

            From what I can tell from the upstream documentation, the widget is mostly an unstyled link for now, pointing to a mailtrain rendered form for subscribing. You would have to style it yourself for now. As it is still marked as experimental, it will probably get enhanced at some point.

            hiyukoimH 2 Replies Last reply
            0
            • nebulonN nebulon

              From what I can tell from the upstream documentation, the widget is mostly an unstyled link for now, pointing to a mailtrain rendered form for subscribing. You would have to style it yourself for now. As it is still marked as experimental, it will probably get enhanced at some point.

              hiyukoimH Offline
              hiyukoimH Offline
              hiyukoim
              translator
              wrote on last edited by
              #5

              @nebulon
              All right! Thank you 😄

              1 Reply Last reply
              0
              • nebulonN nebulon

                From what I can tell from the upstream documentation, the widget is mostly an unstyled link for now, pointing to a mailtrain rendered form for subscribing. You would have to style it yourself for now. As it is still marked as experimental, it will probably get enhanced at some point.

                hiyukoimH Offline
                hiyukoimH Offline
                hiyukoim
                translator
                wrote on last edited by
                #6

                @nebulon
                I tried again, and the widget worked!
                I saw only a simple text link because it was wrong. The correct address starts with https://.
                (The example code start with http:// but Mailtrain on Cloudron uses https://)

                After getting this worked, I'm started to want to customize the widget.
                (e.x. I want to use "Thank you for subscribing!" instead of the default message says "It looks like you are already subscribed to this list.")
                There's a file called widget-subscribe.hbs where we can customize the appearance of the widget.
                However, it is not accessible on Cloudron.

                Is(Will be) there any way to customize the widget?

                1 Reply Last reply
                0
                • 32463 Offline
                  32463 Offline
                  3246
                  wrote on last edited by
                  #7

                  @hiyukoim said in How to make Mailtrain widget work?:

                  Allow subscription widgets to be embedded origins=['https://www.example.com']

                  Sorry to revive an old topic. Is there a way to combine multiple domains in that statement?

                  I assume origins=['https://domain.tld','https://seconddomain.tld'] should work 🤔

                  I still get the CORS policy error despite adding the domain to production.toml file regardless.

                  👉 Find our more www.bebraver.online

                  girishG 1 Reply Last reply
                  0
                  • girishG girish moved this topic from Support on
                  • 32463 3246

                    @hiyukoim said in How to make Mailtrain widget work?:

                    Allow subscription widgets to be embedded origins=['https://www.example.com']

                    Sorry to revive an old topic. Is there a way to combine multiple domains in that statement?

                    I assume origins=['https://domain.tld','https://seconddomain.tld'] should work 🤔

                    I still get the CORS policy error despite adding the domain to production.toml file regardless.

                    girishG Offline
                    girishG Offline
                    girish
                    Staff
                    wrote on last edited by
                    #8

                    @3246 I think that syntax should work (well, per the github config syntax).

                    BTW, mailtrain 1 has not been updated in years since development has stopped. They moved on to mailtrain 2 which is a different code base from mailtrain 1 and not migratable. I would recommend not using mailtrain 1.

                    32463 1 Reply Last reply
                    2
                    • girishG girish

                      @3246 I think that syntax should work (well, per the github config syntax).

                      BTW, mailtrain 1 has not been updated in years since development has stopped. They moved on to mailtrain 2 which is a different code base from mailtrain 1 and not migratable. I would recommend not using mailtrain 1.

                      32463 Offline
                      32463 Offline
                      3246
                      wrote on last edited by
                      #9

                      @girish thanks for the heads-up. I'm using the version packaged with Cloudron. How do I know which one I have?

                      Does the widget not work with v.2.0?

                      👉 Find our more www.bebraver.online

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Bookmarks
                        • Search