Why link your website to your CRM

By | Customer Relationship Management - CRM, Forms, HubSpot, Marketing Automation, Web Design, Wordpress | No Comments

This post runs over why you would connect a CRM (Customer Relationship Management) system ( such as Hubspot) to your website.

Many CRMs now allow you to capture form data on your website and pull this into the CRM, this has the following benefits to you:

  • store users information in your CRM
  • be able to follow up in CRM and have all the interactions in CRM so you can see the history of interactions with that person
  • see what the user has been looking at on your website

 

Hubspot WordPress form integration

The are 2 main ways of taking the users details from your website:

  • a form (standard or popup)
  • a chat box

An example form might look something like above ( this is one I’ve generated in Hubspot , but you can customise and generate your own forms in many ways in Hubspot, manually with HTML or with a tool such as Gravity forms for WordPress, or with other tools). Also remember to make sure you are GDPR compliant if your in the EU.

When the user submits the above form, this is what is will look like in Hubspot.

Hubspot captured lead from WordPress website

 

As you can see the data from the form is recorded in the activity section above and a new contact (Beavis) has been generated in the CRM contacts database. Where you can record all your interactions with this contact ( email , phone and so on ). Emails can also be automatically logged into your CRM and you can automate replies to emails with Marketing Automation sequences. This can be very useful when you have a large number of users (for example your supporters contacting your Charity or Not for Profit Organisation).

I’ve been using Hubspot in this article but the same can be done with others such as Salesforce ( and many others ). I haven’t gone into much technical detail in this post, only why and what are the benefits of this.

CRMs are great for following up and interacting with your supporters, customers, leads and so on. I hope I’ve shown you how you can easily ( and automatically ) put form contacts from your website into your chosen CRM, to make this process easy and save you time.

I plan to write another article on the technical aspects of how todo, what I’ve described briefly ( integrate your WordPress website with a CRM like Hubspot)  in the coming months, but if you’d like help with doing this then please contact us below.

Buddypress cheat sheet

By | Uncategorized | No Comments

in Member loop / directory – show xprofile fields

Just find the field in wp-admin and pop into the function above and echo it.

 

Buddypress how to sort Groups page alphabetically by default

By | Buddypress, PHP, Wordpress | No Comments

In this short blog post I’ll run over how you can sort the Groups index page in Buddypress alphabetically by default (i.e. on first load of page they will be ordered by group name).

Edit or override 2 of the Buddypress templates

You’ll need these in your theme:

wp-content/YOUR_THEMENAME/buddypress/groups/index.php

and

wp-content/YOUR_THEMENAME/buddypress/groups/groups-loop.php

If these templates don’t exist in your theme you’ll need to make copies of the 2 templates from the Buddypress plugin  ( find in buddypress/bp-templates/bp-legacy/buddypress ) and pop into your theme directory in a folder called buddypress. You might need to copy from your parent theme if they are used there ( this is because of the buddypress / wordpress template hierachy – you can look that up if you don’t understand this).

 

Changes in groups-loop buddypress template

Before the bp_has_groups function call you need to add:

and then change the bp_has_groups function to:

 

Changes in index groups template

find this section and change to have alphabetical first ( you could also use the selected attribute ):

 

And thats it job done. Remember Buddypress can save your select choices in the session, which can be confusing – so clearing the cache will help in this scenario.

 

 

 

Laravel ajax calls failing with response code 419

By | Ajax, Laravel, PHP | No Comments

Recently I was working on a Laravel application with some ajax, and I was getting a 419 error after firing an Ajax call to a Laravel controller.

Laravel requires a token to be sent on some types of requests (POST being one of them), this is to prevent Cross site request forgery ( e.g. a form being submitted from somewhere it was intended by the developer to be submitted from ).

In php files its very easy to add this with the function call csrf_field().

But in js files, we need to essentially pull in this you store the token somewhere on the page and use js to pull it in.

you can pop the token in the page somewhere like this:

 

for reference: https://laravel.com/docs/5.5/csrf

 

 

 

 

Laravel how to set a checkbox value to checked based on models value

By | Laravel, PHP | No Comments

In this post I’ll show how to set a Laravel checkbox value to checked based on the value stored on the model.

In this example I’ll be using the Laravel Collective Form checkbox

In the code example above my checkbox is called ‘collected’ the value when checked is ‘yes’ , I wanted to populate my form with the value from the database stored on the model (which is yes or no on the $gas_cert->collected field of the model), the Form::checkbox wants a boolean to decide whether to check the checkbox or not.

I want the form to take either the last input to the collected input or the value in the database (ie if yes check the checkbox).

If I did want to just take into account the model value it could be simplified to this:

 

 

 

How to override the comments form in a child theme

By | Custom Wordpress Theme Development, PHP, Programming, Theming, Wordpress | No Comments

This is a quick post on how to provide your own comments template in your child theme ( overriding comments.php in your parent theme). You can just as easily use the same code to override comments.php if you aren’t using a child theme.

Todo this you need to you need to use the filter ‘comments_template’ ( see the wordpress codex on this filter here)

 

A handy thing you might sometimes want todo is to have a custom comments template, for various custom post types. If you did want todo this you could just add in an if to encase the returned path and filename. e.g.

 

 

Hope someone finds these snippets for how to override comments.php useful.