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. Listmonk
  3. Attributes

Attributes

Scheduled Pinned Locked Moved Listmonk
6 Posts 3 Posters 910 Views 3 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.
    • P Offline
      P Offline
      privsec
      wrote on last edited by
      #1

      Is there a way within listmonk to automatically gather user attributes upon subscribing?

      For example, using this code block

      <form method="post" action="https://domain.com/subscription/form" class="listmonk-form">
          <div>
              <h3>Subscribe</h3>
              <input type="hidden" name="nonce" />
              <p><input type="email" name="email" required placeholder="E-mail" /></p>
              <p><input type="text" name="name" placeholder="Name" /></p>
              <p><input type="text" name="bizname" placeholder="Business Name" /></p>
              <p><input type="tel" name="number" placeholder="Phone Number" /></p>
              <p>
                <input id="bbd0b" type="checkbox" name="l" checked value="redacted" />
                <label for="bbd0b">newsletter</label><br /><span>This will serve as the main newsletter opt-in for all signups</span>
              </p>
      
              <p><input type="submit" value="Subscribe" /></p>
          </div>
      </form>
      

      Does not pass through the business name nor the phone number to the listmonk account
      6da0431b-aa52-4f5f-bc24-9e70dbd8e369-image.png

      girishG 1 Reply Last reply
      0
      • P privsec

        Is there a way within listmonk to automatically gather user attributes upon subscribing?

        For example, using this code block

        <form method="post" action="https://domain.com/subscription/form" class="listmonk-form">
            <div>
                <h3>Subscribe</h3>
                <input type="hidden" name="nonce" />
                <p><input type="email" name="email" required placeholder="E-mail" /></p>
                <p><input type="text" name="name" placeholder="Name" /></p>
                <p><input type="text" name="bizname" placeholder="Business Name" /></p>
                <p><input type="tel" name="number" placeholder="Phone Number" /></p>
                <p>
                  <input id="bbd0b" type="checkbox" name="l" checked value="redacted" />
                  <label for="bbd0b">newsletter</label><br /><span>This will serve as the main newsletter opt-in for all signups</span>
                </p>
        
                <p><input type="submit" value="Subscribe" /></p>
            </div>
        </form>
        

        Does not pass through the business name nor the phone number to the listmonk account
        6da0431b-aa52-4f5f-bc24-9e70dbd8e369-image.png

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

        @privsec Per https://github.com/knadh/listmonk/issues/105 you have to write a custom form and use the API instead of the built-in form.

        P 1 Reply Last reply
        0
        • girishG girish

          @privsec Per https://github.com/knadh/listmonk/issues/105 you have to write a custom form and use the API instead of the built-in form.

          P Offline
          P Offline
          privsec
          wrote on last edited by
          #3

          @girish Ok, Im kinda new to this bit of coding.

          To utilize the API, does cloudron or any app on cloudron assist with this?

          girishG 1 Reply Last reply
          0
          • P privsec

            @girish Ok, Im kinda new to this bit of coding.

            To utilize the API, does cloudron or any app on cloudron assist with this?

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

            @privsec This requires a programmer to use the Listmonk API to add subscribers into Listmonk. It's not straightforward if you are not a developer.

            Or maybe some lo-code app like n8n can help out here. But I am no expert on those apps, maybe someone else can chime in. I would imagine none of those integrate with Listmonk, so you have to "program" anyways.

            P 1 Reply Last reply
            1
            • girishG girish

              @privsec This requires a programmer to use the Listmonk API to add subscribers into Listmonk. It's not straightforward if you are not a developer.

              Or maybe some lo-code app like n8n can help out here. But I am no expert on those apps, maybe someone else can chime in. I would imagine none of those integrate with Listmonk, so you have to "program" anyways.

              P Offline
              P Offline
              privsec
              wrote on last edited by
              #5

              @girish Thank you, I appreciate your response.

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SolarSimon
                wrote on last edited by SolarSimon
                #6

                Hi there, also facing this problem.

                I found in the documentation this Example Request. Sending this via app terminal creates a subscriber with attributes:

                curl -u 'username:password' 'https://listmonk.domain/api/subscribers' -H 'Content-Type: application/json' \
                    --data '{"email":"subsriber@domain.com","name":"The Subscriber","status":"enabled","lists":[1],"attribs":{"city":"Bengaluru","projects":3,"stack":{"languages":["go","python"]}}}'
                

                Now I would like to create a form that fills the $data with according information.

                this already works:

                <?php
                 
                $username='username';
                $password='password';
                $URL='https://listmonk.domain/api/subscribers';
                	   	 
                $data = array(
                	'email' => 'name@domain.com',
                	'name' => 'name',
                	'status' => 'enabled'
                	);
                
                
                $ch = curl_init();
                curl_setopt($ch, CURLOPT_URL,$URL);
                curl_setopt($ch, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
                curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
                curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
                curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
                curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
                
                $result=curl_exec ($ch);
                https://listmonk.domain/api/subscribers' = curl_getinfo($ch, CURLINFO_HTTP_CODE);   //get status code
                curl_close ($ch);
                	  
                echo $result;
                
                ?>	  
                

                someone has a idea how to build the $data array conforming listmonk specification? I dont get lists and attribs working.

                Also it should be possible to trigger listmonk Douple Opt-in e-mail confirmation.

                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