Gangmates
  • Getting Started
  • GENERAL USER GUIDES
    • Directory Services
      • Users
        • Quick Guide for Completing the CSV Template
          • Quick Guide: Formatting the Account Number Column as Text
        • New User Account Activation
      • User Types
      • Third Party Providers
    • Company Services
    • Security
      • Roles
      • Security Settings
    • Configurations
      • Branding
        • Logo
        • Domains
        • Add Email Address Format
          • Custom Expressions for Email Address Format
      • Company Settings
      • Bank Names and Codes Reference
      • Categories and Subcategories
    • Finance
      • Invoice
      • Payroll
        • Create Payslip
          • Understanding Payslip Calculations
        • Payroll Settings
        • Custom Contributions
      • Payment Processing
    • Performance
    • Organization Structure
  • API Documentation
    • API Overview
      • 🔌Authentication
      • ⏱️Rate Limits
    • API Reference
      • Company Management
      • Users Management
      • Payroll Management
        • Payroll Settings
      • Payment Processing
      • Domain Management
      • Wallet Top-Up
      • Invoices Management
  • Legal
    • Compliance and Regulatory Documents
      • Service Agreement
      • Service Level Agreement (SLA)
      • Privacy Policy
      • Data Processing Agreement (DPA)
      • Non-Disclosure Agreement (NDA)
      • Payroll Processing Agreement
      • Master Services Agreement (MSA)
      • Onboarding Checklist
      • Refund Policy
      • Terms and Conditions
Powered by GitBook
On this page
  • Syntax
  • Supported Functions
  • Examples
  • Attribute Placeholders
  • Sample Templates
  1. GENERAL USER GUIDES
  2. Configurations
  3. Branding
  4. Add Email Address Format

Custom Expressions for Email Address Format

This guide provides instructions on how to use custom expressions for email generation within our system. Users can define their email templates using various placeholders and transformation functions.

Syntax

Custom email templates use the following syntax:

  • {attribute}: Refers to a user attribute.

  • {attribute.function(arguments)}: Applies a function to the user attribute.

Supported Functions

  • toLowerCase(): Converts the attribute to lowercase.

  • toUpperCase(): Converts the attribute to uppercase.

  • substring(start, end): Extracts a substring from the attribute.

  • trim(): Removes whitespace from both ends of the attribute.

  • padStart(targetLength, padString): Pads the current string with another string until the resulting string reaches the given length.

  • charAt(index): Returns the character at the specified index.

Examples

Here are some examples of how you can use these functions in your templates:

Basic Usage

  • Template: {first_name}.{last_name}@{domain}

  • Generated Email: john.doe@company.com

Using Transformations

  • Template: {first_name.toLowerCase()}.{last_name.toUpperCase()}@{domain}

  • Generated Email: john.DOE@company.com

Indexing and Substrings

  • Template: {first_name[0].toLowerCase()}.{last_name.substring(0, 3)}@{domain}

  • Generated Email: j.doe@company.com

Trimming and Padding

  • Template: {department.trim()}_{level.padStart(2, '0')}@{domain}

  • Generated Email: engineering_04@company.com

Attribute Placeholders

The following placeholders can be used within templates:

  • {id}: User ID

  • {company_id}: Company ID

  • {manager_id}: Manager ID

  • {employee_id}: Employee ID

  • {first_name}: First Name

  • {last_name}: Last Name

  • {email_verified_at}: Email Verified At

  • {created_at}: Created At

  • {updated_at}: Updated At

  • {personal_email}: Personal Email

  • {unique_id}: Unique ID

  • {user_types}: User Types

  • {address}: Address

  • {phone}: Phone

  • {domain_id}: Domain ID

  • {level}: Level

  • {title}: Title

  • {department}: Department

  • {office_location}: Office Location

  • {payment_frequency}: Payment Frequency

  • {start_date}: Start Date

  • {manager}: Manager

  • {is_active}: Is Active

  • {deleted_at}: Deleted At

Sample Templates

Simple Email

  • Template: {first_name}.{last_name}@{domain}

  • Example: john.doe@company.com

Email with Transformations

  • Template: {first_name.charAt(0).toLowerCase()}.{last_name.toUpperCase()}@{domain}

  • Example: j.DOE@company.com

Complex Email Format

  • Template: {first_name[0].toLowerCase()}{last_name.substring(0, 3).toUpperCase()}@{domain}

  • Example: jDOE@company.com

By following this guide, users can create custom email templates that match their specific needs. For any additional assistance, please refer to our detailed documentation or contact support.

PreviousAdd Email Address FormatNextCompany Settings

Last updated 11 months ago