Important announcements from CouchCMS team
148 posts Page 11 of 15
Previous 1 ... 8, 9, 10, 11, 12, 13, 14, 15 Next
Hey there KK, I'm finally getting to trying out your suggestions! Only a little bit later lol.

I am stuck on one part that you mentioned:

If the admin uses Couch's admin-panel to activate the account, I am afraid there is no provision there to send emails etc.

You'll have to create a front-end section (a variation of members/profile.php) for admins for the purpose and then send the email you require etc.

I'm assuming that on this page I would need to be able to list all users and then have a button that activates them and sends an email. Unfortunately I'm not sure how to go about that. How would I list the users and then setup the activate/email button? Sorry about this, just not skilled enough to figure this out. I would be willing to pay you if I could just get this page fully created for me? I can edit it once made, just not sure how to start out.

Thank you,
BlueCaret
If anyone is available to help me out with my request above I would greatly appreciate it and would be willing to pay $50 for the work. PM if you are interested.

UPDATE: Nevermind I managed to get this figured out with help from a friend.
Hi BlueCaret.

I'm just curious if you really need the complications you want to introduce. In your original question you said,
I would like it to be setup so that upon requesting an account, the user is sent an email that asks them to verify their email, but this does not activate the account, they are told their account will be reviewed and activated later (by an admin). This is so we make sure we get a correct email from them. (emphasis added)

If verifying the email is the only purpose for rerouting the registration through an admin, then it's an unnecessary step. The registration process verifies the email by sending an activation link to the email address. If the user provides an incorrect email, they won't get the link and won't be able to finish creating the account.

I don't see the difference between this automated process and routing the verification through an admin. Were there other reasons that you wanted an admin to verify an account before activation?
tim wrote: Hi BlueCaret.

I'm just curious if you really need the complications you want to introduce. In your original question you said,
I would like it to be setup so that upon requesting an account, the user is sent an email that asks them to verify their email, but this does not activate the account, they are told their account will be reviewed and activated later (by an admin). This is so we make sure we get a correct email from them. (emphasis added)

If verifying the email is the only purpose for rerouting the registration through an admin, then it's an unnecessary step. The registration process verifies the email by sending an activation link to the email address. If the user provides an incorrect email, they won't get the link and won't be able to finish creating the account.

I don't see the difference between this automated process and routing the verification through an admin. Were there other reasons that you wanted an admin to verify an account before activation?


Hi, thanks for the reply. Sorry if that wasn't too clear. Yes there are more reasons, this is for users to view member only content, and these are members who are already part of our association but now would like access to the online content. So an admin needs to verify they are part of the association first before letting them sign up for an online account.

Thanks!
I want to have users enter their email address twice, once to provide it and once to confirm the email. It needs to act just like the repeat password field does, so if it doesn't match it should stop the registration. How would I go about making sure the two fields match?

Thanks!

[UPDATE] Nevermind, I figured this out. Looks like its a simple matter of putting the following on a field:
Code: Select all
matches_field='member_email'
Another question (and thanks for putting up with all the questions I have had!),

I am trying to add extra custom fields to add to members profiles. My problem is when I am filling out the registration form all my fields that I have added that are set as required come back with the message "Required field cannot be left empty" even though I have filled them out.

Here is my code for the members/register.php page:
Code: Select all
<cms:form enctype="multipart/form-data" method='post' anchor='0' class=''>
    <cms:if k_success >
        <!--
            The 'member_process_registration_form' tag below expects fields named
            'member_displayname', 'member_name' (optional), 'member_email',
            'member_password' and 'member_password_repeat'
        -->
        <cms:member_process_registration_form />
        <cms:if k_success >
            <cms:set_flash name='success_msg' value='1' />
            <cms:redirect k_page_link />
        </cms:if>
    </cms:if>
    <cms:if k_error >
        <p class="form-error"><cms:each k_error ><cms:show item /><br /></cms:each></p>
    </cms:if>
    <div class="form-group">
        <label for="member_firstname">First Name*</label>
        <cms:input type='text' name='member_firstname' id='member_firstname' class='form-control' />
    </div>
    <div class="form-group">
        <label for="member_lastname">Last Name*</label>
        <cms:input type='text' name='member_lastname' id='member_lastname' class='form-control' />
    </div>
    <div class="form-group">
        <label for="member_phone">Phone Number*</label>
        <cms:input type='text' name='member_phone' id='member_phone' class='form-control phone' />
    </div>
    <div class="form-group">
        <label for="member_address">Home Address*</label>
        <cms:input type='text' name='member_address' id='member_address' class='form-control' />
    </div>
    <hr>
    <div class="form-group">
        <label for="member_email">Email Address*</label>
        <cms:input type='text' name='member_email' id='member_email' class='form-control' />
    </div>
    <div class="form-group">
        <label for="repeat_member_email">Repeat Email Address*</label>
        <cms:input type='text' name='repeat_member_email' id='repeat_member_email' class='form-control' />
    </div>
    <div class="form-group">
        <label for="member_password">Password*</label>
        <cms:input type='password' name='member_password' id='member_password' class='form-control' />
    </div>
    <div class="form-group">
        <label for="member_password_repeat">Repeat Password*</label>
        <cms:input type='password' name='member_password_repeat' id='member_password_repeat' class='form-control' />
    </div>
    <hr>
    <div class="form-group">
        <label for="member_lot_1">MRTCA Lot Number* (Name must be included on title)</label>
        <cms:input type='text' name='member_lot_1' id='member_lot_1' class='form-control lot-number' />
        <small>Enter lot number in format of "A-1" where "A" is the Territory code and "1" is the lot number.</small>
    </div>
    <div class="form-group">
        <label for="member_lot_2">Additional MRTCA Lot Number (optional)</label>
        <cms:input type='text' name='member_lot_2' id='member_lot_2' class='form-control lot-number' />
    </div>
    <div class="form-group">
        <label for="member_lot_3">Additional MRTCA Lot Number (optional)</label>
        <cms:input type='text' name='member_lot_3' id='member_lot_3' class='form-control lot-number' />
    </div>
    <div class="form-group">
        <label for="member_lot_4">Additional MRTCA Lot Number (optional)</label>
        <cms:input type='text' name='member_lot_4' id='member_lot_4' class='form-control lot-number' />
    </div>
    <div class="form-group">
        <label for="member_lot_5">Additional MRTCA Lot Number (optional)</label>
        <cms:input type='text' name='member_lot_5' id='member_lot_5' class='form-control lot-number' />
    </div>
    <hr>
    <div class="checkbox">
        <cms:input type="checkbox" name="member_bod_updates" id="member_bod_updates" opt_values="Receive email updates from the BOD=Yes" />
    </div>
    <div class="checkbox">
        <cms:input type="checkbox" name="member_terms" id="member_terms" opt_values="Agree to the =Agree" />
        <a href="#">Terms and Conditions</a>*
    </div>
    <cms:input type="submit" name="submit" value="Create account" class="btn btn-success"/>
</cms:form>


And here is the code on the members/index.php page that includes the extra fields:
Code: Select all
        <cms:template clonable='1' title='Members'>

            <cms:member_define_fields />
           
            <!--
                Fields for 'email', 'password' and 'active' already come pre-defined.
                If more fields are required, they can be defined here below in the usual manner.
            -->       

            <cms:editable name='repeat_member_email' label='Display Name/Email Address' desc='This should just be a repeat of the email address field' type='text' required='1' matches_field='member_email' />
            <cms:editable name='member_firstname' label='First Name' type='text' required='1' />
            <cms:editable name='member_lastname' label='Last Name' type='text' required='1' />
            <cms:editable name='member_phone' label='Phone Number' type='text' required='1' />
            <cms:editable name='member_address' label='Home Address' desc='Full address of member.' type='text' required='1' />
            <cms:editable name='member_lot_1' label='1st Lot #' desc='Enter lot number in format of "A-1". Only one lot per field.' type='text' required='1' />
            <cms:editable name='member_lot_2' label='2nd Lot #' desc='Enter lot number in format of "A-1". Only one lot per field.' type='text' />
            <cms:editable name='member_lot_3' label='3rd Lot #' desc='Enter lot number in format of "A-1". Only one lot per field.' type='text' />
            <cms:editable name='member_lot_4' label='4th Lot #' desc='Enter lot number in format of "A-1". Only one lot per field.' type='text' />
            <cms:editable name='member_lot_5' label='5th Lot #' desc='Enter lot number in format of "A-1". Only one lot per field. Only 5 lots can be assigned to a single account' type='text' />
            <cms:editable name='member_bod_updates' label='Email Updates' desc='Member agrees to get email updates from the BOD' type='checkbox' opt_values="Receive email updates from the BOD=Yes" />
            <cms:editable name='member_terms' label='Terms and Conditions' desc='Member agrees to Terms and Conditions' type='checkbox' required='1' opt_values="Agree to the Terms and Conditions=Agree" />

        </cms:template>


What am I doing wrong here?
Hi BlueCaret. These last two are easy. On your form you are using type='text'. But this is a data-bound form. All form fields should be type='bound'.

Also you have the wrong syntax for the repeat email validator. It should be validator='matches_field=member_email'.

I think this will clear up your troubles.

I have also been working (slowly) on your previous question. Are you still looking for help with the process of notifying members?
tim wrote: Hi BlueCaret. These last two are easy. On your form you are using type='text'. But this is a data-bound form. All form fields should be type='bound'.

Also you have the wrong syntax for the repeat email validator. It should be validator='matches_field=member_email'.


Ah yes that makes sense! I knew it had to just be something stupid! Awesome, thanks Tim!

tim wrote: I have also been working (slowly) on your previous question. Are you still looking for help with the process of notifying members?


So sorry if you have already put some time into this but no I don't need this anymore, went a slightly different route with this that works even better for me with the help of a friend. I edited my original post but must not have been obvious enough, sorry for any unnecessary work!! I really do appreciate the help though!
So sorry if you have already put some time into this but no I don't need this anymore, went a slightly different route with this that works even better for me with the help of a friend. I edited my original post but must not have been obvious enough, sorry for any unnecessary work!! I really do appreciate the help though!

No trouble. I only work on these problems when they're fun and educational for me. In case it helps you or someone else, here are the ideas I had.

I’m going to assume that you were able to derail the registration process like KK suggested so that instead of activating the account an email is sent to the admin to verify the member's credentials.

At this point, the account will be set up in the members.php template, but it will be deactivated by being 'unpublished' in the admin panel. To activate an account, the admin simply hits the 'published' button and saves the page. There is no provision for doing this in bulk as far as I know. Each account will have to be activated separately.

When it comes to sending an email to the member letting them know that their account is active, what if the admin... sends them an email? They could keep a stock response that they copy and paste into an email and fire it off using an administrator's email account. Like @KK mentioned, it wouldn't be possible (or appropriate) to send someone their password. Just tell them they can login using the email and password they used to sign up and send a link to the members section. If they forgot their password, Couch has provisions for them to reset it.

If you would prefer to allow the admin to use the website for notification, you can create a simple form for them to use. Let's start by restricting access so only administrators can use it.
Code: Select all
<?php require_once( 'couch/cms.php' ); ?>
<cms:template title='Notify' hidden='1' access_level='7' />

The email address is the only thing needed for the form to send a notification. The following is essentially lifted straight from the documentation.
Code: Select all
<cms:form method="post">
    <cms:if k_success >
        <h3>Notification has been sent to <cms:show frm_email />.</h3>
        <cms:send_mail from='<cms:k_email_from />' to='<cms:show frm_email />' subject='Access to Members Area Approved'>
            Your access to the members area of the Affiliated Association of Organizations has been approved. Access the online resources at aao.org/resources/ using your email address and the password that you used to register.
            <cms:show k_success />
        </cms:send_mail>
    </cms:if>
   
    <cms:if k_error >
        <h3>Failed to submit form</h3>
        <cms:each k_error >
            <cms:show item /><br>
        </cms:each>
    </cms:if>


    Email: <cms:input type="text" size="10" name="email" /> <br />
   
    <cms:input name="submit" type="submit" value="Send Notification" />
</cms:form>

This will do the job, but let's refine it. We don't want to have to type in a bunch of email addresses. That's too much work and prone to error. In addition, I'd like to be able to handle multiple notifications at once.

This form uses a checkbox for the input that shows all member emails using the cms:pages tag. The newest will be at the top of the list. A notification is then sent to each of the selected emails.
Code: Select all
<cms:form method="post">
    <cms:if k_success >
        <h3>Notification has been sent to:</h3>

       <cms:each frm_email>
           <cms:send_mail from='<cms:k_email_from />' to='<cms:show item />' subject='Access to Members Area Approved'>
               Your access to the members area of the Affiliated Association of Organizations has been approved. Access the online resources at aao.org/resources/ using your email address and the password that you used to register.
              <cms:show k_success />
           </cms:send_mail>
           <cms:show item/>
        </cms:each>
    </cms:if>
   
    <cms:if k_error >
        <h3>Failed to submit form</h3>
        <cms:each k_error >
            <cms:show item /><br>
        </cms:each>
    </cms:if>


    Choose accounts to notify:<br>
    <cms:input type="checkbox" name="email" opt_values="<cms:pages masterpage="members/index.php" >k_member_email | </cms:pages>" /> <br />
   
    <cms:input name="submit" type="submit" value="Send Notifications" />
</cms:form>

You could refine this by only showing members activated during the last week or so. Of course, the admin still has to remember which members need to be notified.

This is OK. But what would be really nice is if Couch would keep track of who has been notified or not, and automate the process of notification. We'll start by adding a checkbox to the members template to indicate whether the member has been notified.
Code: Select all
<cms:editable
  name="notified"
  label="Has the member been notified of their account activation? "
  opt_values='Yes=1'
  type='checkbox'
/>

Now we'll use the pages and db_persist_form tags to automate the whole process. This will be it's own separate template. When the admin visits the page, it runs through all activated, un-notified members, sends an email and checks the box. Let's see if it works.
Code: Select all
<cms:pages masterpage='members/index.php'>
   <cms:if notified='0' >
      <cms:form
          masterpage=k_template_name
          page_id=k_page_id
          mode='edit'
          enctype='multipart/form-data'
          method='post'
          anchor='0' >

            <cms:db_persist_form
              _invalidate_cache='0'
              notified='1' />
           
            <cms:send_mail from='<cms:k_email_from />' to='<cms:show member_email />' subject='Access to Members Area Approved'>
                Your access to the members area of the Affiliated Association of Organizations has been approved. Access the online resources at aao.org/resources/ using your email address and the password that you used to register.
             </cms:send_mail>

             <p><cms:show member_email /> has been notified.</p>
      </cms:form>   
    </cms:if>
</cms:pages>

All of this code is untested, so I'm sorry if there are any errors. The last option in particular is an untested concept. Please try them. If you run into trouble, let us know and hopefully someone will be able to sort it out.
Is it possible to keep members logged in even if the browser is closed? Like facebook.
Previous 1 ... 8, 9, 10, 11, 12, 13, 14, 15 Next
148 posts Page 11 of 15

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 2 guests