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


Navigation

    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    SOLVED How to make Mailtrain widget work?

    Support
    2
    6
    573
    Loading More Posts
    • 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.
    • hiyukoim
      hiyukoim last edited by

      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 Reply Quote 0
      • nebulon
        nebulon Staff last edited by

        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 Reply Quote 1
        • hiyukoim
          hiyukoim last edited by

          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 Reply Quote 0
          • nebulon
            nebulon Staff last edited by

            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.

            hiyukoim 2 Replies Last reply Reply Quote 0
            • hiyukoim
              hiyukoim @nebulon last edited by

              @nebulon
              All right! Thank you 😄

              1 Reply Last reply Reply Quote 0
              • hiyukoim
                hiyukoim @nebulon last edited by

                @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 Reply Quote 0
                • First post
                  Last post