Automatically send new members welcome e-mail and redirecting registration form?

  • Hi there,

    I'm currently working with the Perch Members app and I have some questions regarding the status of new members and automatically sending them welcome e-mails. Currently when you register the account status is automatically "active", which is perfectly fine except I need to manually click on "Send welcome email" within Perch. The weird thing is though, the form had "New members require approval" ticked by default, but none the less new member account seem to be "active" without my permission. In the end this isn't an issue for me since I don't want to approve each member, I simply want the welcome email to be sent automatically. Another question I had was when filling in the registration form the new user is automatically signed in. Is it possible to keep the new user signed out send a verification email which contains a link where they verify their email get sent to a login page? Also how can I redirect the user to a different page where I have setup a login form?


    I hope someone can help me out!


    Kind regards,


    Quincy

  • Gareth S

    Approved the thread.
  • Ok, so I made some progression, when using the setting "New members require approval" the welcome e-mail is sent. I have also figured out how to redirect to a different page after registering. The things I still can't get to work are;


    - Sending welcome e-mails with the setting "New members require approval" turned off.

    - Preventing the the auto-login when a new user registers.

    - Optional: Any way of using verification tokens/links for new members. I have tried fiddling around with Pipit Members, but unfortunately without any luck. The Pipit documentation seems to be very short.


    I hope someone can help me out!


  • QuincyN Any updates on this?

  • I hope someone can help me out!


    > "Sending welcome e-mails with the setting "New members require approval" turned off."

    Simply click save on the member's detail page with the welcome email checkbox checked. Their status needs to be active.

    > "Preventing auto-login when a new user registers."

    In the member form settings, check "New members require approval".

    > "Any way of using verification tokens/links for new members. I have tried fiddling around with Pipit Members, but unfortunately without any luck. The Pipit documentation seems to be very short."

    Yes the pipit_members docs are missing some details. I have it working and it's very useful, but there's a few things to be aware of.

    It's important to know the verification is not "secure", as mentioned by Hussein on Github. It means you shouldn't use the verification to grant members any more privileges than unverified members. Treat it like a minor signal. In my case, I use it as one of many signals to verify member integrity. The member gets a green tick on their profile page, which looks nice because who doesn't like a green tick!

    Things missing from the pipit_members docs that weren't obvious to me:

    You need to add a "verify.html" template to your /perch/templates/members/emails folder. In that template, your verification link will look something like below... note the id of the token.


    https://<perch:email id="http_host" />/member-profile/verify-email?token=<perch:email id="verify_token">


    The form which sends the email can be called like any form...


    perch_member_form('send_verify_email.html');


    And that form lives in templates/members/forms, and what it looks like is in the pipit_members docs.


    I ended up adding a "pending" tag based on both the 10 minute timer, and whether someone has clicked the email link, and doing a few extra things to make it all run smoothly, but that's optional.


    The best thing about pipit_members is how the member doesn't need to log out and back in to see any updated tag assignments. Also being able to query an individual member by email address to check if they have a tag is also a game-changer over the basic members app. It means you can build member admin pages separate from Perch control panel for members you've assigned as staff for example. But note there's a minor bug in the app (I think) which causes an error if you search by member email instead of member id... So for example :


    if( pipit_members_has_tag('email-verified',$member_email) ) {


    This caused a server error for me, so instead you can first find the member, then id and use that instead of email :


    $the_member = pipit_members_find( $member_email );


    then


    $the_member_id = $the_member['memberID'];


    then the below will work without error...


    if( pipit_members_has_tag('email-verified',$the_member_id) ) {


    Even though the Members app is limited, once you add pipit_members, you can build a lot of things on top for managing tags and doing interesting things with member account profiles and different member tiers. Importantly, you can build things without going too deep into PHP apart from a few conditional statements etc.