def update_template_strings(variable, quote_results):
    """
    The following function will replace all {{ tag }} variables in the template with the results from the quote
    results. The current variables are;

    Groups
    ~~~~~~
    1.) Quotes
    2.) Organisatiions
    3.) Quote Billing Address
    """
    variable = variable.replace('{{ customer_id }}', str(quote_results.
        customer_id))
    variable = variable.replace('{{ customer_notes }}', quote_results.
        customer_notes)
    variable = variable.replace('{{ is_invoice }}', quote_results.is_invoice)
    variable = variable.replace('{{ opportunity_id }}', str(quote_results.
        opportunity_id))
    variable = variable.replace('{{ organisation_id }}', str(quote_results.
        organisation_id))
    variable = variable.replace('{{ project_id }}', str(quote_results.
        project_id))
    variable = variable.replace('{{ quote_billing_address }}', str(
        quote_results.quote_billing_address))
    variable = variable.replace('{{ quote_id }}', str(quote_results.quote_id))
    variable = variable.replace('{{ quote_stage_id }}', str(quote_results.
        quote_stage_id))
    variable = variable.replace('{{ quote_terms }}', quote_results.quote_terms)
    variable = variable.replace('{{ quote_title }}', quote_results.quote_title)
    variable = variable.replace('{{ quote_valid_till }}', str(quote_results
        .quote_valid_till))
    variable = variable.replace('{{ task_id }}', str(quote_results.task_id))
    if quote_results.organisation_id:
        variable = variable.replace('{{ organisation_name }}',
            quote_results.organisation_id.organisation_name)
        variable = variable.replace('{{ organisation_website }}',
            quote_results.organisation_id.organisation_website)
        variable = variable.replace('{{ organisation_email }}',
            quote_results.organisation_id.organisation_email)
    else:
        variable = variable.replace('{{ organisation_name }}', '')
        variable = variable.replace('{{ organisation_website }}', '')
        variable = variable.replace('{{ organisation_email }}', '')
    if quote_results.quote_billing_address:
        variable = variable.replace('{{ billing_address1 }}', quote_results
            .quote_billing_address.campus_address1)
        variable = variable.replace('{{ billing_address2 }}', quote_results
            .quote_billing_address.campus_address2)
        variable = variable.replace('{{ billing_address3 }}', quote_results
            .quote_billing_address.campus_address3)
        variable = variable.replace('{{ campus_id }}', str(quote_results.
            quote_billing_address.campus_id))
        variable = variable.replace('{{ campus_nickname }}', quote_results.
            quote_billing_address.campus_nickname)
        variable = variable.replace('{{ campus_phone }}', quote_results.
            quote_billing_address.campus_phone)
        variable = variable.replace('{{ campus_region_id }}', str(
            quote_results.quote_billing_address.campus_region_id))
        variable = variable.replace('{{ billing_suburb }}', quote_results.
            quote_billing_address.campus_suburb)
        if quote_results.quote_billing_address.campus_postcode == None:
            variable = variable.replace('{{ billing_postcode }}', '')
        else:
            variable = variable.replace('{{ billing_postcode }}', str(
                quote_results.quote_billing_address.campus_postcode))
        variable = variable.replace('{{ billing_region }}', str(
            quote_results.quote_billing_address.campus_region_id))
        variable = variable.replace('{{ billing_country }}', str(
            quote_results.quote_billing_address.campus_country_id))
    else:
        variable = variable.replace('{{ billing_address1 }}', '')
        variable = variable.replace('{{ billing_address2 }}', '')
        variable = variable.replace('{{ billing_address3 }}', '')
        variable = variable.replace('{{ billing_postcode }}', '')
        variable = variable.replace('{{ campus_id }}', '')
        variable = variable.replace('{{ campus_nickname }}', '')
        variable = variable.replace('{{ campus_phone }}', '')
        variable = variable.replace('{{ campus_region_id }}', '')
        variable = variable.replace('{{ billing_suburb }}', '')
        variable = variable.replace('{{ billing_region }}', '')
        variable = variable.replace('{{ billing_country }}', '')
    return variable
