We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • A Plugin could enable automatically subscribing users during web user creation, and removing them during disabling/blocking them (just a different approach). A Module could enable syncing an existing group of users.
      Ryan Thrash, MODX Co-Founder
      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
      • 9550
      • 123 Posts
      Blake,

      Just tried out the snippet but can’t seem to get it to display a chunk. How do you get it to default chunk?
        • 3536
        • 9 Posts
        Quote from: featherodd at Nov 19, 2009, 12:55 AM

        Blake,

        Just tried out the snippet but can’t seem to get it to display a chunk. How do you get it to default chunk?

        Hi featherodd,

        Thanks for trying that out. To display a chunk you just need to enter the name of it in the tpl attribute. For example, say you had a chunk called "ExampleChunk" you’d do something like:

        [!CM.Register? &tpl=`ExampleChunk`!]

        Does that work for you?
          • 9550
          • 123 Posts
          This part I understand. Buy I don’t know how to format my chunk (classes, ID’s, expected form fields) to work with this snippet. What I was asking for was how to get it to spit out a default chunk? To modify into my own. Or is there documentation on this?
            • 9550
            • 123 Posts
            anyone? Bueller?
              • 3536
              • 9 Posts
              Quote from: featherodd at Nov 23, 2009, 01:38 AM

              This part I understand. Buy I don’t know how to format my chunk (classes, ID’s, expected form fields) to work with this snippet. What I was asking for was how to get it to spit out a default chunk? To modify into my own. Or is there documentation on this?

              What you’ll need to do is create a form with the name "websignupfrm" and that POSTs the data to [+action+]:
              <form action="[+action+]" method="post" name="websignupfrm">

              In that form you’ll need to have a checkbox with the name "subscribe" - if any value is submitted for "subscribe" (i.e. it is checked) then the user will be added to your CM list.

              Other than that you’ll also need fields with the following names: username, fullname, email, password, confirmpassword, country, state, zip, and (if you are using a CAPTCHA) formcode. The fullname and email fields contain data that is submitted to CM, while the rest have data to create the MODx users.

              You’ll also need to give the submit button the name "cmdwebsignup".

              Does that help?
                • 2270
                • 2 Posts
                I’m just trying to implement the linked zip file now, and am getting an error:

                « MODx Parse Error »
                MODx encountered the following error while attempting to parse the requested resource:
                « PHP Parse Error »

                PHP error debug
                Error: include_once(/usr/local/pem/vhosts/103568/webspace/httpdocs/assets/snippets/campaignmonitor/register.tpl.php): failed to open stream: No such file or directory
                Error type/ Nr.: Warning - 2
                File: /usr/local/pem/vhosts/103568/webspace/httpdocs/manager/includes/document.parser.class.inc.php(770) : eval()’d code
                Line: 21

                Parser timing
                MySQL: 0.0074 s (14 Requests)
                PHP: 0.0246 s
                Total: 0.0321 s

                The zip file didn’t contain any register.tpl.php

                I have my snippet as follows:
                [!CM.Register? &formid=`eSubscriptionForm` &useCaptcha=`0` &tpl=`Form.CM.Register` &apikey=`XXXXX` &lists=`Members` !]
                and my form:

                [+validationmessage+]
                <form method="post" action="[~[*id*]~]">
                <input type="hidden" name="formid" value="eSubscriptionForm" />
                <fieldset .....

                any help would be much appreciated thanks
                  • 3536
                  • 9 Posts
                  Quote from: ashramsey at Jan 29, 2010, 01:59 AM

                  I’m just trying to implement the linked zip file now, and am getting an error:

                  I think the issue here is that I’m an idiot. I put an old register.snippet.php file in the ZIP file. embarrassed Try the attached file instead.

                  If people want different features or an actual plug-in please provide suggestions. What is here is just a basic snippet as it wasn’t clear what people here wanted and what could be useful.
                    • 19849
                    • 19 Posts
                    Hi Blake

                    Sounds like you’re being a bit hard on yourself there wink Thanks for the interest in MODx and taking the time to write a test snippet.

                    Your suggestions sound pretty cool to me

                    ...it would be useful to allow members to opt-in to your mailing list and automatically sync their details over to your Campaign Monitor account... I’m thinking there’d be a “register” form that you can drop anywhere in your site. Users fill in the form and they are added as a web user, they would also be able to tick checkboxes corresponding to lists they want to subscribe to.

                    It would also be nice if a user could edit their subscription from within a MODx site, maybe with a similar drop-in form where a logged-in user can check and uncheck the lists they wish to subscribe to?

                    Extensions to the user form sounds like a good start, plus for admins to be able to subscribe/unsubscribe users from lists, move users between lists, perhaps automatically subscribe/unsubscribe if moved into certain user groups. I’m with @Expanism in saying the EE and WP plugins look like they have pretty useful functionality.

                    Hope that’s helpful. Pretty tied up just now with urgent work projects but if things quieten down a bit I’ll do my best to try what you’ve coded so far...

                    Kind regards

                    Martin

                      • 9550
                      • 123 Posts
                      Just tried this reposted code again and still can’t get it to spit out anything. I went through all the standard steps. Not sure what I’m doing wrong.

                      - The folder "campaignmonitor" containing "register.inc.php" & "cmbase.php" is in my snippets directory.

                      - Created a new snippet called "CM.Register" with the contents of "register.snippet.php" as the snippet’s code.

                      No matter how I vary the snippet call, with or without &tpl, with my parameters or the example one, I get bupkus, notta, nilch, nothing.

                      note: I’ve tried leaving the &tpl call blank, referencing a chunk with the content "testing," and referencing a chunk containing the default form code from "register.inc.php" minus the php snippets. Also, [!WebSignup!] spits out a default snippet just fine.

                      Have double and tripple checked the syntax. Please help.